|
-
Oct 9th, 2000, 11:58 AM
#1
Thread Starter
Lively Member
i need to find out how i can print information from a list box. lets say i have items in a list box as if a receipt, now i need to print the list box so that the printer only prints the list box and no the whole form. Please help!!!!!
-
Oct 9th, 2000, 12:05 PM
#2
Frenzied Member
Code:
Private Sub Command1_Click()
Dim str As String
Static x As Integer
For x = 0 To List1.ListCount
'put all listitems in a string
str = str & List1.List(x) & vbCrLf
Next x
'Print that string
Printer.Print str
Printer.EndDoc
End Sub
Jop - validweb.nl
Alcohol doesn't solve any problems, but then again, neither does milk.
-
Oct 9th, 2000, 01:54 PM
#3
Why did you declare X as Static?
-
Oct 9th, 2000, 02:09 PM
#4
Frenzied Member
Otherwise it won't get updated in a sub right? (or was that for something else 
[Edited by Jop on 10-09-2000 at 03:25 PM]
Jop - validweb.nl
Alcohol doesn't solve any problems, but then again, neither does milk.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|