D
Dave
Here is my code
On Error GoTo Err_cmdFilter_Click
On Error Resume Next
Dim stDocName As String
DoCmd.ShowAllRecords
If Forms!frmInmates.txtStartDate = "" Or Forms!frmInmates.txtEndDate =
"" Then
MsgBox "You Must enter Dates in the Date Fields"
Else
Me.Filter = "SentenceStartDate >= #" & txtStartDate & "# And
ReimburseEndDate <= #" & txtEndDate & "#"
End If
Me.FilterOn = True
'SendKeys "{F2}"
txtStartDate.SetFocus
Exit_cmdFilter_Click:
Exit Sub
Err_cmdFilter_Click:
MsgBox Err.Description
Resume Exit_cmdFilter_Click
txtStartDate and txtEndDate are date fields and if they are empty I want the
msgbox to pop up but as I have coded this, it does not.
What have I done wrong?
Any help here will be appreciated.
Thanks in advance
Dave
On Error GoTo Err_cmdFilter_Click
On Error Resume Next
Dim stDocName As String
DoCmd.ShowAllRecords
If Forms!frmInmates.txtStartDate = "" Or Forms!frmInmates.txtEndDate =
"" Then
MsgBox "You Must enter Dates in the Date Fields"
Else
Me.Filter = "SentenceStartDate >= #" & txtStartDate & "# And
ReimburseEndDate <= #" & txtEndDate & "#"
End If
Me.FilterOn = True
'SendKeys "{F2}"
txtStartDate.SetFocus
Exit_cmdFilter_Click:
Exit Sub
Err_cmdFilter_Click:
MsgBox Err.Description
Resume Exit_cmdFilter_Click
txtStartDate and txtEndDate are date fields and if they are empty I want the
msgbox to pop up but as I have coded this, it does not.
What have I done wrong?
Any help here will be appreciated.
Thanks in advance
Dave