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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

print QUERY in landscape

Status
Not open for further replies.

ricm9

Programmer
Jun 7, 2002
20
US
Is it possible to use code to change the printer property when printing a query? I see lots of info about how to change it for a report, but not when printing a query.

I have a form where the user selects from available fields to dynamically generates a query, and I send the results to another form's list box. The user NOW wants to print the results, so my plan was to have a button call the query and just print it using the "PrintOut" method. However, since the number of fields can vary, I don't think I can dynamically create a new report for the query and use the methods I see in this forum to print it in landscape orientation.

... does anyone else have any ideas?
 
I would just create a unbound landscape report and link a text control to the other form's list box.
Trisha
padinka@yahoo.com
 
How?

I tried referencing the list box directly, it's control source, and the query that is the control source directly. None worked.
 
Interesting problem. When it didn't work, what happened?

I can suggest that what you need to do is grab the RowSource of the listbox and push that into the RecordSource of the report in the report's OnOpen event. Something like:

Code:
Me.RecordSource = Form_FormName!ListBoxName.RowSource

You need the fully qualified form name in order for the control to be found by the report.

I don't know if this is what your problem was, but it is a likely place to go astray. If you have done this, and it still doesn't work, then provide more details on how you did it and what result you actually got.
Peleg
PelegNOSPAM@PStrauss.net
 
I will be happy to send you an example database. Just contact me via email and I will send it back.
Trisha
padinka@yahoo.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top