Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PASSING DIFFERENT CONTROLSOURCE TO ONE REPORT

Status
Not open for further replies.

Angelique

Technical User
Mar 9, 2001
127
AU
In an effort to reduce the size of my database, I had hoped to assign different queries depending on the user's response to the same report. A suggestion to use a form that would allow the user to select the desired report.

Could someone enlarge on this suggestion? A sample always goes a long way.

Thanks in advance.

Angelique
 
Well,

No sample here, and while there are ways to assign different recordsources to a form, I much prefer to simply create a single query as the recordsource - but the only thing this query does is select the 'real' datasource for the form.

Basically, you will always need to 'know' which (of the several) queries you intend to use, and they all need to have all of the fields used in the form. Call the canidate queries "qry1", "qry2", ... "qryN" call the recordsource query qryReal.

In the selection procedure:

Select case YourSelectionCriteria
[tab]Case CriteriaForQry1
[tab][tab]qryReal.Sql = "Select * from Qry1;"

[tab]Case CriteriaForQry2
[tab][tab]qryReal.Sql = "Select * from Qry2;"

[tab]Case CriteriaForQry3
[tab][tab]qryReal.Sql = "Select * from Qry3;"

other selections

End Select

There are some details, so the above is NOT an example, just a 'starting point'.



MichaelRed
redmsp@erols.com

There is never time to do it right but there is always time to do it over
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top