doctorswamp
Technical User
Hi
Nearly there following earlier help.
Want to print label for current record in a form. Have report called Labels and use this code on the form's command button.
Private Sub cmdLabel_Click()
On Error GoTo Err_cmdLabel_Click
Dim stDocName As String
stDocName = "Labels"
DoCmd.OpenReport stDocName, acPreview, , "Company=" & Me.Company
Exit_cmdLabel_Click:
Exit Sub
Err_cmdLabel_Click:
MsgBox Err.Description
Resume Exit_cmdLabel_Click
End Sub
It comes back with 'Syntax error (missing operator) in query expression '[Company = Bowes]' when on using the command button on record Bowes.
Sorry to be slow with VB, which seems hard to get into - must be plain man's guides somewhere!
Nearly there following earlier help.
Want to print label for current record in a form. Have report called Labels and use this code on the form's command button.
Private Sub cmdLabel_Click()
On Error GoTo Err_cmdLabel_Click
Dim stDocName As String
stDocName = "Labels"
DoCmd.OpenReport stDocName, acPreview, , "Company=" & Me.Company
Exit_cmdLabel_Click:
Exit Sub
Err_cmdLabel_Click:
MsgBox Err.Description
Resume Exit_cmdLabel_Click
End Sub
It comes back with 'Syntax error (missing operator) in query expression '[Company = Bowes]' when on using the command button on record Bowes.
Sorry to be slow with VB, which seems hard to get into - must be plain man's guides somewhere!