Hi there,

For some reason my program's not working too well. There's 2 command buttons, a label and 2 forms. When the command button is pressed, 'I want' & number & 'sweets' appears in the label.

number is a random number from 1 to 9.

Then when the other button is pressed, form2 loads, and the number string should appear in a label on that form. But it doesn't. I've tried having number as a string, integer, etc, but still no luck.

Could you please take a look at my code? Thanks for any help.

Dim number As Integer

Private Sub Command1_Click()
Randomize
number = Int(Rnd * 9)
Label1 = "I want " & number & " sweets."
End Sub

Private Sub Command2_Click()
Form2.Show
End Sub


Private Sub Form_Load()
Label1 = number
End Sub