I am using MS Access 2003 with VB 6.5. I am trying to reference the page number variable with my cmdPrint so that whatever page is currently on my form will print and no others. I have it working for everything except when I use the find/search function as my counter (labels X at the moment) doesnt function correctly when I jump to a record out of sequence. my code looks like this so far:
Private Sub cmdPrint_Click( )
On Error GoTo Err_cmdPrint_Cl ick
DoCmd.PrintOut acPages, X, X ' Print current page based on counter variable "X"
Exit_cmdPrint_C lick:
Exit Sub
Err_cmdPrint_Cl ick:
MsgBox Err.Description
Resume Exit_cmdPrint_C lick
End Sub
X adds one when the user clicks next and subtracts one when the user goes previous and the mouse wheel is deactivated. So if the user only uses the next and previous keys everything works splendid.
VB and Access help tell me that the variable [Page] is my page variable but everytime I attempt to make reference to it I get the error:
Page =< You entered an expressions that has an invalid reference to the pro...
How to I get around this so that I can make reference to this variable?
Private Sub cmdPrint_Click( )
On Error GoTo Err_cmdPrint_Cl ick
DoCmd.PrintOut acPages, X, X ' Print current page based on counter variable "X"
Exit_cmdPrint_C lick:
Exit Sub
Err_cmdPrint_Cl ick:
MsgBox Err.Description
Resume Exit_cmdPrint_C lick
End Sub
X adds one when the user clicks next and subtracts one when the user goes previous and the mouse wheel is deactivated. So if the user only uses the next and previous keys everything works splendid.
VB and Access help tell me that the variable [Page] is my page variable but everytime I attempt to make reference to it I get the error:
Page =< You entered an expressions that has an invalid reference to the pro...
How to I get around this so that I can make reference to this variable?
Comment