I am trying to create a macro to print the current page of a report. I need a macro because I would like to create a custom toolbar which has an icon that when clicked will print only the current page in the report showing. I am using Access 97 for the database. Does anyone know how the VB code should be written to do this?
I have also created simple code to bring up the Print Dialogue box for the same reason, to print selectable pages by the user. If I click cancel in the Print Dialogue box I get the response “The RunCommand Action was cancelled”. The code is below, is there a way to avoid this response in the cancel button is clicked. I am sure I need to add something to it The code is:
Function Test_Print()
On Error GoTo Err_Test_Print
DoCmd.RunCommand acCmdPrint
Exit_Test_Print:
Exit Function
Err_Test_Print:
MsgBox Err.Description
Resume Exit_Test_Print
End Function
Thanks for the help, I really appreciate it!
Tfrank
I have also created simple code to bring up the Print Dialogue box for the same reason, to print selectable pages by the user. If I click cancel in the Print Dialogue box I get the response “The RunCommand Action was cancelled”. The code is below, is there a way to avoid this response in the cancel button is clicked. I am sure I need to add something to it The code is:
Function Test_Print()
On Error GoTo Err_Test_Print
DoCmd.RunCommand acCmdPrint
Exit_Test_Print:
Exit Function
Err_Test_Print:
MsgBox Err.Description
Resume Exit_Test_Print
End Function
Thanks for the help, I really appreciate it!
Tfrank