Many are under the impression that when they stand at the last judgment, if their good deeds outweigh their bad, then they will gain entrance to heaven. First of all, I wouldn't want to count on my good outweighing my bad.
But further, that belief is just not true. Those who seek to be accepted by God on the basis of their works must understand that they need to keep God's law perfectly. A lifetime of complete compliance to God's law is required.
John Calvin elaborates:
Works righteousness is perfect obedience to the law. Therefore, you cannot be righteous according to works unless you unfailingly follow this straight line, so to speak, throughout life. The minute you turn aside from it, you slip into unrighteousness. From this it is apparent that righteousness does not come about from one or a few works but from an unwavering and unwearying observance of the divine will. But very different is the rule for judging unrighteousness. For a fornicator or thief is by one offense guilty of death because he has offended against God's majesty. (Institutes of the Christian Religion 3.18.10)
In truth, the commandments of Scripture, because they set the bar so impossibly high (due to our sinful natures), encourage us to seek Christ, for the commandments of Scripture must be kept perfectly for us to be righteous.
John Calvin again:
With a clear voice we too proclaim that these commandments are to be kept if one seeks life in works. And Christians must know this doctrine, for how could they flee to Christ unless they recognized that they had plunged from the way of life over the brink of death? How could they realize how far they had wandered from the way of life unless they first understood what that way is like? Only, therefore, when they distinguish how great is the difference between their life and divine righteousness that consists in accepting the law are they made aware of this, in order to recover salvation, their refuge is in Christ. (3.18.9)