J
Jessica
This is my very simple code to print certain records from a form:
Private Sub cmbMassPrint_Click()
On Error GoTo Err_cmbMassPrint_Click
Dim StartPage, EndPage As Long
StartPage = InputBox("What record number [not ID!] do I start from?",
"Print Range")
EndPage = InputBox("What record number [not ID!] do I end at?", "Print
Range")
DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
DoCmd.PrintOut acPages, StartPage, EndPage
Exit_cmbMassPrint_Click:
Exit Sub
Err_cmbMassPrint_Click:
MsgBox Err.Description
Resume Exit_cmbMassPrint_Click
End Sub
I originally had:
Dim StartPage, EndPage As Integer
but this produce an overflow error when we reaches over 32767 records.
So I changed it to:
Dim StartPage, EndPage As Long
and now I get this error message:
An expression you entered is the wrong data type for one of the arguments.
You tried to run a macro or use a method to carry out an action, but an
expression evaluated to the wrong data type. For example, for the Close
method you specified a string for the Object Type argument, but this argument
can be set only to certain intrinsic constants or their numeric equivalents.
Help! please...
~Jessica
Private Sub cmbMassPrint_Click()
On Error GoTo Err_cmbMassPrint_Click
Dim StartPage, EndPage As Long
StartPage = InputBox("What record number [not ID!] do I start from?",
"Print Range")
EndPage = InputBox("What record number [not ID!] do I end at?", "Print
Range")
DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
DoCmd.PrintOut acPages, StartPage, EndPage
Exit_cmbMassPrint_Click:
Exit Sub
Err_cmbMassPrint_Click:
MsgBox Err.Description
Resume Exit_cmbMassPrint_Click
End Sub
I originally had:
Dim StartPage, EndPage As Integer
but this produce an overflow error when we reaches over 32767 records.
So I changed it to:
Dim StartPage, EndPage As Long
and now I get this error message:
An expression you entered is the wrong data type for one of the arguments.
You tried to run a macro or use a method to carry out an action, but an
expression evaluated to the wrong data type. For example, for the Close
method you specified a string for the Object Type argument, but this argument
can be set only to certain intrinsic constants or their numeric equivalents.
Help! please...
~Jessica