Most of the time, INKEY$ returns "", that is, the empty string. This happens when there are no pending key presses. ASC will explode if you supply it with an empty string.
So, you'll want something like
IF LEN(KB$) = 1 THEN 'if there actually is a key press
in your loop.
|Response Title||Author and Date|
|Thanks..works great now....||unseenmachine on Feb 23|
|RE: "This happens when there are no pending key presses"||Galleon on Feb 27|
|i know||unseenmachine on Feb 28|