printing a form

binghamw

BingleyW
Local time
Today, 05:50
Joined
Apr 22, 2004
Messages
57
I have created a form where the user selects two combo boxes, and the resulting records show up in the fields below.

I want to create a report that reads off this form LIVE including what was selected from the combo boxes.

Also, I have not used any queries for this, and I would prefer not to go back and change it.

Any ideas on this one?
 
You need to save the current record prior to opening the report.
DoCmd.RunCommand acCmdSaveRecord

Then you can use the OpenReport method with the where argument to filter the report. However, if your table is large, it is far better to base the report on a query and use the form fields as selection criteria to limit the number of rows selected.

I don't know what your aversion to queries is all about. It is better to use queries as the recordsources for your forms and reports and in a properly normalized database, it is imperative since you will almost always need to join two or more tables to obtain a meaningful recordsource. It is quite easy to change the recordsource from a table to a query. Just replace the tablename with a queryname.
 
Pat,

That worked really well. I also changed the record source of the form to a query and it solved a few more problems. It was definitely easier than I thought.

thanks!
 

Users who are viewing this thread

Back
Top Bottom