Form issue from Dec 17 continues...

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi there, than you for all responses...I am still really confused. My appologies

Here is the situation. I have one form that could be used with 4 different queries. I am not sure how to put the appropriate query to the form. For example

if the user is on the Area information page, i want the Query qryAreaInformation to be the record source of the Information Form
if the user is on the Province information page, i want theQuery qryProvinceInformation to the record source for the Information Form
etc

How do i accomplish this? The form doesn't need to change, jsut hte recordset supplied to it does

Many thanks

Carle
 
From your earlier post I remember you saying that you are using buttons to
open the form. So the code for each of the buttons should have a line that
looks something like:

DoCmd.OpenForm "Information"

For the button that goes to the Area Info add the following after the line
above:

Forms!Information.RecordSource="qryAreaInformation"

Do the same for each button changing "qry..." with the appropriate query
name.

Kelvin

Carlee said:
Hi there, than you for all responses...I am still really confused. My appologies.

Here is the situation. I have one form that could be used with 4
different queries. I am not sure how to put the appropriate query to the
form. For example:
if the user is on the Area information page, i want the Query
qryAreaInformation to be the record source of the Information Form.
if the user is on the Province information page, i want theQuery
qryProvinceInformation to the record source for the Information Form.
 
It had to be that easy!!!! Thanks for the time to re-explain....you are my hero for today!
 
Actually my earlier suggestion was a little different. I will re-explain
that suggastion in case you want to try it.

For the Area button use the command below to open the form:

DoCmd.OpenForm "Information", acNormal, , , , , "qryAreaInformation"

Change the code for each button changing the last part with the name of the
query you want to use. This passes the string "qryAreaInformation" as a
variable called OpenArgs to the form. Then on the Open event of the
Information form use:

Me.RecordSource = Me.OpenArgs

Good luck.

Kelvin

CArlee said:
It had to be that easy!!!! Thanks for the time to re-explain....you are
my hero for today!
 
Back
Top