I need that if the person don't fill any field in a form and press the button "Open ReportByDate" then appear a msgbox that indicate
lease fill any field. If the person fill any field then open a "rptBySelectionReportForm". The code is the following, but this not funtion, please help me in this code.
Private Sub cmdOpenReportByDate_Click()
Dim stDocName As String
If IsNull(Me![txtByDate]) Or (Me![txtCompany]) Or (Me![txtTimeIn]) Or (Me![txtTypeOfPerson]) Or (Me![Check14]) = " " Then
MsgBox "Please fill any field", vbOKOnly, "Error!!!"
Me![txtByDate].SetFocus
Exit Sub
End If
stDocName = "rptBySelectionReportForm"
DoCmd.OpenReport stDocName, acPreview
DoCmd.OpenReport stDocName, acPreview
DoCmd.RunCommand acCmdZoom100
End Sub
Private Sub cmdOpenReportByDate_Click()
Dim stDocName As String
If IsNull(Me![txtByDate]) Or (Me![txtCompany]) Or (Me![txtTimeIn]) Or (Me![txtTypeOfPerson]) Or (Me![Check14]) = " " Then
MsgBox "Please fill any field", vbOKOnly, "Error!!!"
Me![txtByDate].SetFocus
Exit Sub
End If
stDocName = "rptBySelectionReportForm"
DoCmd.OpenReport stDocName, acPreview
DoCmd.OpenReport stDocName, acPreview
DoCmd.RunCommand acCmdZoom100
End Sub