ID: 421
Viewed: 3588
Added: Aug 19, 2002
Version:
Snippet uploaded by: snippet
Written By: Unknown
Demo: Sorry, no demo
Thank you for your vote. Please wait...
It appears you already voted for this snippet
It appears your vote value was empty
I've done 3 apps that needed formatted printing, lists in rows or columns with Name, Date, Lines, boxes etc. I could never get "Print Form" to give me the detail I needed. If you write a sub putting the info you need into variables and then print the variables at the (X,Y) coordinates you want the info displayed it works very well, is quick and with a bit of trial and error will look just the way you want. Any info needed that is in a data base, list box can usually be printed with a loop to change the position.
Highlight all by clicking in box
<!---Declaration--->
none
Highlight All
<!---Code--->
Dim f As Integer ' counter for anystring()
Dim k As Integer 'counter for column's
Dim Col(0 To 3), NR '4 column's and next row
Printer.CurrentX = HorizontalMargin / 1.5
Col(0) = 10
Col(1) = 58
Col(2) = 106 'column width of 48 mm (adjust to suit the job)
Col(3) = 154
NR = 53
For f = LBound(anystring) To UBound(anystring) '### anystring can be numbers, text, list box contents
Printer.CurrentX = HorizontalMargin + (Col(k)) 'EG: 10 mm this time 58 mm next time etc.
Printer.CurrentY = VerticalMargin + (NR) 'EG: 53 mm first time 60 mm next then 67 mm ect.
Printer.Print anystring(f)
k = k + 1 'Next column on the next loop
If k = 4 Then NR = NR + 7: k = 0 'If you have 4 anystrings in this row, start a new row
If NR > 270 Then Printer.NewPage: NR = 20 'Enough on this page
Next f 'Loop;
No Comments to show
Please completely fill out the form below if you want to review this snippet. All reviews are subject to validation.
Adding your comment. Please wait...
Thanks for adding your comment!. After further review it will be added.
There was a problem adding your comment. Please try again.
Please complete all the fields in the form before sending.