Command button opening subform

Sander

Registered User.
Local time
Today, 23:12
Joined
Jun 6, 2001
Messages
20
Help! I have a form that has 9 subforms on it. Right now the subforms are NOT visible. What I want to do is when a command button is pressed, a combo box will be checked on the form and if there is information in there then the first subform will appear. (Once I can get that working, the next time the button is clicked it would check to see if both boxes are filled in and if so then bring up the second subform, etc, etc) If there is nothing in the box then nothing happens. I know this requires an IF statement but no matter how I try and set it up it doesn't work. I've been trying different versions of the statement in the OnClick section of the command button. Is this right? Right now this is what I have:

Private Sub Command181_Click()
If Input.Models1 = Null Then
Me.sub2.Visible = True
End If

End Sub

Input is the form and Models1 is the combobox. It keeps saying there is a syntax error. I haven't used VB in like 3 years and my book isn't much help. If anyone could help me I would sure appreciate it. I've been trying to figure this out for two days now. Thank You!
 
if not isnull(me!models1) then
me!sub2.visible=true
else
me!sub2.visible=false
end if
 

Users who are viewing this thread

Back
Top Bottom