How to show dailogbox to print after whileclosing a query using vb

  • Thread starter Thread starter HelpNeeded
  • Start date Start date
H

HelpNeeded

Hi all,
Is it possible to show a dailogbox to print or not,when a query ios closed.
The query is executed from form using vba. after user reviews the query, if
user wants to print it, it shoud show a dailog asking user to print the query
as soon the user closes the query.
Thanks.
 
Hi all,
Is it possible to show a dailogbox to print or not,when a query ios closed.
The query is executed from form using vba. after user reviews the query, if
user wants to print it, it shoud show a dailog asking user to print the query
as soon the user closes the query.
Thanks.

Queries are not designed for printing.
Create a report laying out the data anyway you wish, using the query
as it's record source.
Open the report in preview
DoCmd.OpenReport "ReportName", acViewPreview

If the user then wishes to print the report, all he/she need do is
click on the Print tool button while the report is displayed, or open
the Print dialog.... File + Print and print from there.
 
Thanks for replying. CAnI configure print settings in report layout.???

You configure the margins, orientation, paper size, etc. of a report
when you are in report design view by clicking on File + Page Setup.
Once that is done, those settings stay with the report until changed.

To then print the report while it is open in Preview, click on File +
Print (which opens the Print dialog for the number of pages and/or
copies) or simply click on the Print tool button (which prints the
full report, without dialog).
 
Back
Top