option group code

  • Thread starter Thread starter angie
  • Start date Start date
A

angie

i have entered the following code but i get error message 13:

Private Sub vehicle_criteria_AfterUpdate()
If Me.vehicle_criteria = 2 Then
DoCmd.Minimize
DoCmd.OpenForm "Form2-VEHICLES"
Else
DoCmd.CLOSE "Form2-VEHICLES"
End If
End Sub

my goal is to minimize the current form and open or close another form
according to the option selected. what am i doing wrong?
 
The syntax for the Close method is:

DoCmd.Close [objecttype, objectname], [save]

Try using

DoCmd.Close acForm, "Form2-VEHICLES"
 
Back
Top