Group:  Microsoft Access ยป microsoft.public.access.formscoding
Thread: option group code

Geek News

option group code
angie 11/21/2008 10:32:09 AM
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?
Re: option group code
"Douglas J. Steele" <NOSPAM_djsteele[ at ]NOSPAM_gmail.com> 11/21/2008 11:54:40 AM
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?


Home | Search | Terms | Imprint Contact
Newsgroups Reader - provided by WiredBox.Net