Referencing a UserForm in a Module

  • Thread starter Thread starter Patrick C. Simonds
  • Start date Start date
P

Patrick C. Simonds

I want to setup a module that will interact with UserForm1. During UserForm
Initialization I want to call the Missing Data routine and have if check the
values of Optionbuttons 2212 and 2213 (on UserForm1) and if they are False
then change the BackColor and BorderColor of
Frame 2202, which is also on UserForm1.

I know I can do this by placing the code within the UserForm but there are
over 3000 lines of code for this UserForm and I am hoping that by moving
some of this off to individual modules I can make my coded more manageable.



Sub MissingData()
'
'
'

'
With UserForm1
'Current No Show Data Check


'No Show 1 Data Check

If OptionButton2212.Value = False Then
If OptionButton2212.Value = False Then
Frame2202.BackColor = &H80FFFF
Frame2202.BorderColor = &HFF&
End If
End If

End With

End Sub
 
Hi Patrick,

You should just have to preface teh control refernce witha refernce to
the userform. Using your sample code, something like this should work:

If Userform1.OptionButton2212.Value = False Then
 
Back
Top