AJS
10-04-2004, 07:57 PM
Hi,
What's wrong with the following code? I'm trying to load up and format a userform based on the selection in a listbox, but I get an "object doesn't support this property or method" error message at the "SetForm.Show vbModeless" line.
Thanks, Aaron.
Private Sub OKButton1_Click()
' load a userform
Dim SetForm As UserForm
If ToolList.ListIndex < 0 Then ToolList.ListIndex = 0
If StrComp(ToolList.Value, "Vernier Calipers", 1) = 0 Then
Set SetForm = GaugeLink_Measurement
ElseIf StrComp(ToolList.Value, "Pass/Fail", 1) = 0 Then
Set SetForm = PassFail_Measurement
Else
Set SetForm = VisionGauge_Measurement
End If
SetForm.Show vbModeless
' rest of code...
end sub
What's wrong with the following code? I'm trying to load up and format a userform based on the selection in a listbox, but I get an "object doesn't support this property or method" error message at the "SetForm.Show vbModeless" line.
Thanks, Aaron.
Private Sub OKButton1_Click()
' load a userform
Dim SetForm As UserForm
If ToolList.ListIndex < 0 Then ToolList.ListIndex = 0
If StrComp(ToolList.Value, "Vernier Calipers", 1) = 0 Then
Set SetForm = GaugeLink_Measurement
ElseIf StrComp(ToolList.Value, "Pass/Fail", 1) = 0 Then
Set SetForm = PassFail_Measurement
Else
Set SetForm = VisionGauge_Measurement
End If
SetForm.Show vbModeless
' rest of code...
end sub