R
Randy
MS Access 2000. I have a report that is run from a cmd button on a form.
This fires the perameter update query, sql below and then a report is
imediately run. The problem is, if the input box from the query is left
blank, the report ("Summary by Certificate Number")
still runs but with a null value in the field "DateIssued" I need to
prevent the report from running if the input box is inadvertantly left
blank. Thanks in advance.
UPDATE QUERY BELOW:
UPDATE AnalysisForm SET AnalysisForm.DateIssued = [InsertDateIssued]
WHERE
(((AnalysisForm.CertNumber)=[Forms]![IncomingNotesheet]![CertNumber]));
REPORT BELOW:
Private Sub Summary_with_date_issued_Click()
On Error GoTo Err_Summary_with_date_issued_Click
Dim stDocName As String
Dim strWhere As String
DoCmd.SetWarnings False
If Me.Dirty Then 'Save any edits first.
Me.Dirty = False
End If
If Me.NewRecord Then
MsgBox "Field Note Not Selected. Please Select a Field Note To
Print"
Else
stDocName = "InsertDateIssued"
DoCmd.OpenQuery stDocName
stDocName = "Summary by Certificate Number"
DoCmd.OpenReport stDocName, acViewNormal, , strWhere
Exit_Summary_with_date_issued_Click:
Exit Sub
Err_Summary_with_date_issued_Click:
Resume Exit_Summary_with_date_issued_Click
DoCmd.SetWarnings True
End If
End Sub
This fires the perameter update query, sql below and then a report is
imediately run. The problem is, if the input box from the query is left
blank, the report ("Summary by Certificate Number")
still runs but with a null value in the field "DateIssued" I need to
prevent the report from running if the input box is inadvertantly left
blank. Thanks in advance.
UPDATE QUERY BELOW:
UPDATE AnalysisForm SET AnalysisForm.DateIssued = [InsertDateIssued]
WHERE
(((AnalysisForm.CertNumber)=[Forms]![IncomingNotesheet]![CertNumber]));
REPORT BELOW:
Private Sub Summary_with_date_issued_Click()
On Error GoTo Err_Summary_with_date_issued_Click
Dim stDocName As String
Dim strWhere As String
DoCmd.SetWarnings False
If Me.Dirty Then 'Save any edits first.
Me.Dirty = False
End If
If Me.NewRecord Then
MsgBox "Field Note Not Selected. Please Select a Field Note To
Print"
Else
stDocName = "InsertDateIssued"
DoCmd.OpenQuery stDocName
stDocName = "Summary by Certificate Number"
DoCmd.OpenReport stDocName, acViewNormal, , strWhere
Exit_Summary_with_date_issued_Click:
Exit Sub
Err_Summary_with_date_issued_Click:
Resume Exit_Summary_with_date_issued_Click
DoCmd.SetWarnings True
End If
End Sub