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

passing variables to PrintOut

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
How do I pass variables to the PrintOut command. I am using this within an Event Procedure triggered by on_click event
for a command button on my Access Form. Need to be able to
pass variables for Page Range, From, To parameters in the
PrintOut command. These are entered as unbound text fields
on my Access Form.
 
If you have textboxes txtFrom and txtTo, pass their values to Integer variables, e.g. StartPage and End Page, then put these in as parameters expected by the PrintOut command,

Dim StartPage as Integer, Endpage as Integer

StartPage = Val(txtFrom)
EndPage = Val(txtTo)

e.g. DoCmd.PrintOut acPages, StartPage, EndPage, acHigh, 1
Have fun! :eek:)

Alex Middleton
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top