option group code

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?
 
D

Douglas J. Steele

The syntax for the Close method is:

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

Try using

DoCmd.Close acForm, "Form2-VEHICLES"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top