|
-
Apr 5th, 2000, 05:37 PM
#1
Thread Starter
Lively Member
Hi,
I have a form. On my form I have 2 labels - label1 and label2.
When my form loads, I use the following code to have it so that label2 is always 1 less than label1:
Private Sub Form_Load()
Randomize
Label1 = Int(Rnd * 10) + 1
Label2 = Val(Label1) - 1
End Sub
But this isn't exactly what I'm trying to acheive. I want label2 to also be a random number. That is, each time the form loads, it will either be 1 less or 1 higher than label1.
For example, If Label1 is 6, Label2 might be 5 or 7.
Could someone please help me to do this?
Thanks.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|