Hello everyone,
I am very new with VB printing. I set this program up to print tickets for a frozen custard business. It prints about 99% of the time. For some reason it randomly decides to not print. I really cant figure out why it doesnt work... there is no pattern or any reason why it shouldnt work. I believe that the windows printing is kind of getting jammed up... Is there anyway to make it print all of this in a more efficient way.

Thank you.


'this is in a different function----------------------------------------
PrintDialog1.PrinterSettings.PrinterName = "EPSON TM-T88IV Receipt"
PrintDocument1.PrinterSettings = PrintDialog1.PrinterSettings

PrintDocument1.Print()
---------------------------------------------------------------------

Private Sub PrintDocument1_PrintPage(ByVal sender As System.Object, ByVal e As System.Drawing.Printing.PrintPageEventArgs) Handles PrintDocument1.PrintPage
Dim text As String

text = Stat_Lbl_Total.Text & vbNewLine
For i As Int32 = 0 To LstBox_Order.Items.Count - 1
text += " " & LstBox_Order.Items(i).ToString & " $" & (ProductTableAdapter.GetItemData_Name(LstBox_Order.Items(i).ToString()).Rows(0).Item(3).ToString) & vbNewLine
Next
text += vbNewLine & vbNewLine & "Subtotal: " & Subtotal.ToString("C2") & vbNewLine & "Tax: " & Tax.ToString("C2") & _
vbNewLine & "Total: " & Total.ToString("C2") & vbNewLine & vbNewLine & vbNewLine & vbNewLine & " "
e.Graphics.DrawString(text, LstBox_Order.Font, Brushes.Black, 50, 50)
e.HasMorePages = False