By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,930 Members | 1,269 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,930 IT Pros & Developers. It's quick & easy.

Access Data Form Doesn't Allow Printing All Records

P: 39
Hi

I have a form in Access which is bound. I have a series of reports that are produced whoch the user can print.

However when the user is on the data form if they click print, they print all records, each record as a screen print!

Is there any way of stopping this?

Thanks
Jun 4 '08 #1
Share this Question
Share on Google+
5 Replies


Expert Mod 2.5K+
P: 2,545
I suspect that when the command button for printing the report was placed on the form the wizard was used and Print Form was selected instead of Print (or Preview) Report. You will be able to tell for certain if you go to the code for the On Click event of the command button. If the code of the On click sub says something like this
Expand|Select|Wrap|Line Numbers
  1. DoCmd.SelectObject acForm, stDocName, True
  2. DoCmd.PrintOut
  3. DoCmd.SelectObject acForm, MyForm.Name, False
replace it with
Expand|Select|Wrap|Line Numbers
  1. DoCmd.OpenReport stDocName, acPreview
where stDocName is the name of your report. This will open the report in print preview mode (which then allows the user to select a printer to print the report and so on).

-Stewart
Jun 4 '08 #2

P: 39
I suspect that when the command button for printing the report was placed on the form the wizard was used and Print Form was selected instead of Print (or Preview) Report. You will be able to tell for certain if you go to the code for the On Click event of the command button. If the code of the On click sub says something like this
Expand|Select|Wrap|Line Numbers
  1. DoCmd.SelectObject acForm, stDocName, True
  2. DoCmd.PrintOut
  3. DoCmd.SelectObject acForm, MyForm.Name, False
replace it with
Expand|Select|Wrap|Line Numbers
  1. DoCmd.OpenReport stDocName, acPreview
where stDocName is the name of your report. This will open the report in print preview mode (which then allows the user to select a printer to print the report and so on).

-Stewart
Hi Stewart

Thanks for the reply but I dont think I explained myself very well!!

The 'print' is the basic print command on the menubar. When the user is on a dataform if they click Select Print from the drop down menu it prints all records on the form as screenshots.

I want the print option but only for printing reports. any way of stopping printing when the user is on a form?

Thanks
Jun 5 '08 #3

Expert Mod 2.5K+
P: 2,545
Well, you could modify the menu to remove or disable the print command, or you could provide a custom menu for your users (a better option) but my own preference would be to add a command button to the main form which allows the users to print without selecting menu options to do so.

-Stewart
Jun 5 '08 #4

P: 39
Well, you could modify the menu to remove or disable the print command, or you could provide a custom menu for your users (a better option) but my own preference would be to add a command button to the main form which allows the users to print without selecting menu options to do so.

-Stewart
Well i have got a custom menu but it has the print button on it!!

I also have a command button on the form which previews a report but then I need a menu item to allow the user to print the report. If i code my own custom menu item eg

docmd.Printout rptName

it prints the whole report and doesnt bring up the print dialog screen. So therefore Im using the default print menu item provided by microsoft so I can display the print dialog screen. But this means the print menu item is available when just the main form is showing and therefore users can print all the records off as screenshots!!

I just want a print menu item which only allows the user to print a report not a form.

I hope this makes sense.
Jun 6 '08 #5

P: 39
Well i have got a custom menu but it has the print button on it!!

I also have a command button on the form which previews a report but then I need a menu item to allow the user to print the report. If i code my own custom menu item eg

docmd.Printout rptName

it prints the whole report and doesnt bring up the print dialog screen. So therefore Im using the default print menu item provided by microsoft so I can display the print dialog screen. But this means the print menu item is available when just the main form is showing and therefore users can print all the records off as screenshots!!

I just want a print menu item which only allows the user to print a report not a form.

I hope this makes sense.
Hi Stewart

I think Ive solved my problem. I have just disabled the menu which allows users to print and then enabled it when they load a report and then disable it again when they close the report. Seems to be working OK.

Thanks for your help
Jun 6 '08 #6

Post your reply

Sign in to post your reply or Sign up for a free account.