View Single Post
  #3  
Old November 5th, 2009, 11:28 PM posted to microsoft.public.access.forms
Mr. B[_4_]
external usenet poster
 
Posts: 171
Default option button to control form query

You can also use VBA code in the After Update event of the Group control to
set the desired query as the record source for your form.

Set the record source for your form to which ever query you want to use when
the form first opens.

Make the first option in the Group control to refer to the recordset from
the default query.

Set the default value of the Group control to 1.

Then in the After Update event of the Group control use code like the
following:

If Me.NameOfYourGourpControl= 1 Then
Me.RecordSource = "NameOfDefaultQuery"
Else
Me.RecordSource = "NameOfSecondQuery"
End If

-----
HTH
Mr. B
http://www.askdoctoraccess.com/
Doctor Access Downloads Page:
http://www.askdoctoraccess.com/DownloadPage.htm


"ehops" wrote:

Hello all-

I have two identical forms. They only differ by the select statement in
their queries. I would like eliminate one of the forms and use a radio
button in the footer to choose which query to use. Anyone have any
suggestions?

It seems pretty simple. I am somewhat new to Access.

Thanks for your help.

---ehops