There are different ways to approach this based on your actuall requirement.
-- You can use a timer and make the timer active when x=1 and inactive when its not.
-- else you can use the sleep and then resume when the value of x changes.
Both methods depends on where you use it.
Thank you Binoj for the prompt response.
For my code, either if I use the timer or sleep, x will not change by itself unless the program continues again.
Is there a way that sleep can be deactivated by a key stroke? Surprisingly VB6 doesn't recognizes Sleep!!