Glory
Well-known Member
- Joined
- Mar 16, 2011
- Messages
- 640
There's apparently no easy way to affect an option button on one userform from another.
One userform has one option button and one command button. The other userform has one command button on it.
Clicking the command button on first userform the loads the second userform. Clicking the command button on the second userform is supposed to set the value of the option button on the first userform to "-1" (selected).
Code:
Userform1:
UserForm2
The end result is that the option button on userform 1 becomes "null", and from time to time messing around with code like this I get an error message that reads "Invalid use of null".
Please help me out with this. I need to be able to affect an option button on a userform from an external userform.
One userform has one option button and one command button. The other userform has one command button on it.
Clicking the command button on first userform the loads the second userform. Clicking the command button on the second userform is supposed to set the value of the option button on the first userform to "-1" (selected).
Code:
Userform1:
Code:
Private sub commandbutton1_click()
UserForm2.Show
End Sub
UserForm2
Code:
Private sub commandbutton1_click()
Userform1.OptionButton1.Value = -1
End Sub
The end result is that the option button on userform 1 becomes "null", and from time to time messing around with code like this I get an error message that reads "Invalid use of null".
Please help me out with this. I need to be able to affect an option button on a userform from an external userform.