|
请教高手,下面程序的Application.Printer = "TSC TTP-243E Pro 在 LPT1: "
那个地方设置对吗,由于连接的多台打印机,需要代码指定打印机,谢谢
Private Sub Command8_Click()
On Error GoTo Err_Command8_Click
Dim strWhere As String
strWhere = Me.form5查询子窗体1.Form.Filter
If strWhere = "" Then
'没有条件
strSQL = "SELECT * FROM [form5查询]"
Else
'有条件
strSQL = "SELECT * FROM [form5查询] WHERE " & strWhere
End If
Set qdf = CurrentDb.QueryDefs("查询1")
qdf.SQL = strSQL
qdf.Close
Set qdf = Nothing
DoCmd.OpenReport "标签查询2", acViewPreview, , strWhere
DoCmd.PrintOut , , , acHigh, , True
Application.Printer = "TSC TTP-243E Pro 在 LPT1: "
DoCmd.PrintOut "标签查询2"
Exit_Command8_Click:
Exit Sub
Err_Command8_Click:
MsgBox Err.Description
Resume Exit_Command8_Click
End Sub |
|