Now I only can print selected row from datagrid, how to print all row from datagrid when I click the checkbox (print all)??
see attachment
Private Sub Print2_Click()
If COM1.Value = True Then
MSComm1.CommPort = 1
Else
COM1.Value = False
LPT1.Value = True
End If
If LPT1.Value = False Then
MSComm1.PortOpen = True
If MSComm1.DSRHolding = False Then
MsgBox "Printer Not Ready", vbCritical, "Error"
MSComm1.PortOpen = False
Exit Sub
End If
End If
If MsgBox(" Are you sure to print", vbOKCancel, "Print") = vbCancel Then
Exit Sub
End If
text1.text = rs.field("code1")
qtty = Format$(Val(Qtytxt2.Text), "0000")
If LPT1.Value = True Then
Printer.Print "{D0391,0919,0360|}"
Printer.Print "{C|}"
Printer.Print "{D0391,0919,0360|}"
Printer.Print "{AX;+000,+000,+00|}"
Printer.Print "{AY;+00,0|}"
Printer.Print "{PC000;0116,0162,20,25,K,00,B|}"
Printer.Print "{RC00;" & text1.text & "|}"
Printer.Print "{XB00;0210,0200,A,3,03,0,0144,+0000000000,000,0,00|}"
Printer.Print "{RB00;>5>8>6" & text1.text & "|}"
Printer.Print "{XS;I," & qtty & ",0002C6200|}"
Printer.EndDoc
Else
Printer.Print "{D0391,0919,0360|}"
Printer.Print "{C|}"
Printer.Print "{D0391,0919,0360|}"
Printer.Print "{AX;+000,+000,+00|}"
Printer.Print "{AY;+00,0|}"
Printer.Print "{PC000;0116,0162,20,25,K,00,B|}"
Printer.Print "{RC00;" & text1.text & "|}"
Printer.Print "{XB00;0210,0200,A,3,03,0,0144,+0000000000,000,0,00|}"
Printer.Print "{RB00;>5>8>6" & text1.text & "|}"
Printer.Print "{XS;I," & qtty & ",0002C6200|}"
Printer.EndDoc
End If
End Sub
Attached File(s)
-
picture1.bmp (70.83K)
Number of downloads: 76

New Topic/Question
Reply



MultiQuote



|