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

advice on printing a form

Status
Not open for further replies.

MinnKota

Technical User
Nov 19, 2003
166
US
I do not want the user to be able to print all 100 records in the database. So I have removed the print menu, and want to replace it with a button that prints the current record. Also, can I permanently remove the ALL option in the print dialog? And maybe I will need to disable the Ctrl + P keystroke.
 
I ususally don't let the user print the form (because it never looks as good on paper, plus other reasons). Rather, I create a report and in the OnOpen statement of the report I set the filter properties and OrderBy property equal to what the form is set to (also check to see if the form is in form view or datasheet view). Also, I change the action of the print and print preview buttons so that they open the report assigned to the form. To determine which report to open I use a naming convention. For example, if the activeform is named frmMyForm, then the report that is opened is rptMyForm. Finally, I give the user an option, via the menu bar, to print just the current record. Which, opens the report using the Where argument of the docmd.openreport method.
 
thanks for the report advice. I'm sure that I will use it in another application, BUT like I said in my post, I want to print the form. I have printed it before and it looks pretty good.
 
Gut instinct says open the form with a query selecting only the records you want, then print it.

OR....

If you know the exact page numbers you can create a button that will print the form using the access wizards. If you then step into the code for the onClick event of the button you can change the:

DoCmd.PrintOut

to something like

DoCmd.PrintOut acPages, 1, 5, ,

This would print the first five pages. All of the above is in the access help files






DJ - Just plugging away, can't wait for deployment day...

 
Create a Macro and name it say; Print Current Record.
In the first Macro Action line select: RunCommand and in the command line select; SelectRecord.
In the second Action line select; PrintOut and in the Print Range line select; Selection.

Then in your form design, create a command Print button and in the OnClick event, select the Macro.

 
Thanks Tomcat - exactly what I needed and it took me nearly a minute to find this thread. Have a star on me, you've just saved me a lot of head scratching.

<signature for rent>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top