The syntax for the Close method is:
DoCmd.Close [objecttype, objectname], [save]
Try using
DoCmd.Close acForm, "Form2-VEHICLES"
-- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no private e-mails, please)
"angie" <angie[ at ]discussions.microsoft.com> wrote in message news:0DB6069F-D1DC-4DBB-A083-F7D3E20BF2D9[ at ]microsoft.com...
[Quoted Text] >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?
|