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.