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!!!!!
Printable View
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!!!!!
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
Why did you declare X as Static?
Otherwise it won't get updated in a sub right? (or was that for something else :confused:
[Edited by Jop on 10-09-2000 at 03:25 PM]