Guys,

This question may sound complicated... And I was hoping it's possible to do it. what I wanted is to have random number to change when variable is true or 1, then change the random number can change back to original when variable is false or 0 for example here's snippet:

VB Code:
  1. Dim Lucky As Byte
  2. Dim LuckyNum As Variant
  3.  
  4. If Lucky = 1 Then
  5.  
  6.  Lucky = 258 + 2 + 4 - 1
  7.  
  8. Else
  9.  
  10.  Lucky = 258 - 2 - 4 + 1
  11.  
  12. End If
  13.  
  14. LuckyNum = Lucky
  15. Print format(LuckyNum, "000" ' If true Print will show 263 otherwise it will go back to number 258



I have tried this similar code using command1 button as if I pressed to be true, and I end up with overflow and could not understand why, Also, I was expecting number to increase sequently in delay time for instance when its true or 1, the display will show 258,260,264 then 263. When its false or 0 it will countdown sequently 264,260,258 and etc. Perhaps, I have done wrong or anything. done search on this site seeing if anyone ever encountered or trying these methods... and end up with no luck. Can anyone help?