Calls print-out options
Calls print-out options
API Declarations
Name of form name and source parameters needed
Rate Calls print-out options
(2(2 Vote))
On Error GoTo ErrHandler
Dim strSQL As String
Dim strQryName As String
Dim strMsg As String
strQryName = "[form to be printed]"
strMsg = "Your query has been successfully printed."
strSQL = Nz(Me.txtSQL2.Value, "000") [will have to be adapted]
If strSQL <> "000" And strSQL <> "" Then
'If user enters a string, finish processing
'Open target file
DoCmd.OpenForm "[form to be printed]"
'Run print dialogue
DoCmd.RunCommand acCmdPrint
DoCmd.Close 'close file
Me.RecordSource = strSQL
Else
'No input, alert user & reset focus
strMsg = "Please make sure that all parameters are defined."
Me.txtSQL.Undo
End If
MsgBox strMsg
'Show confirmation message whether failed or successful
ExitHere:
Exit Sub
ErrHandler:
MsgBox Err.Description
Resume ExitHere
End Sub
Calls print-out options Comments
No comments yet — be the first to post one!
Post a Comment