View Single Post
  #4  
Old November 6th, 2009, 04:02 AM posted to microsoft.public.access.forms
ehops
external usenet poster
 
Posts: 2
Default option button to control form query

Mr. B-

Thank you!!! I can't figure out how to rate this, but your reply works
perfectly. I am an 'old' programmer from an old 4GL language that has long
been shelved. I have long since migrated to the operations world. I am now
fooling around with Access to try to make the world better for an outfit that
only uses excel. I know enough about db's to be dangerous. Thank you so
much for your help!!

---ehops


"Mr. B" wrote:

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