T
Ted
hi, when i try to run this code behind the click event of a cmd button to
test the error trapping logic i decided to add to it, i seem to keep getting
a small box displaying bearing the message in the Subject.
can somebody show me the error of my ways?
discordant code follows immediately below:
Private Sub TrackSite_Click()
Dim Response As Integer
On Error GoTo Err_TrackSite_Click
Dim stDocName As String
Dim strWhere As String
If Me.StartDate Is Not Null And Me.StopDate <> #1/1/1899# Then
stDocName = "Patients on Follow-Up"
strWhere = "[FollowUp] Between #" & _
Forms![Tracking Print]![StartDate] & _
"# And #" & Forms![Tracking Print]![StopDate] & "#"
DoCmd.OpenReport stDocName, acViewPreview, , strWhere
Else
Response = MsgBox("You have failed to enter valid dates. Review and
correct your entries.", vbOKOnly + vbCritical, "Error")
End If
Exit_TrackSite_Click:
Exit Sub
Err_TrackSite_Click:
MsgBox Err.description
Resume Exit_TrackSite_Click
End Sub
test the error trapping logic i decided to add to it, i seem to keep getting
a small box displaying bearing the message in the Subject.
can somebody show me the error of my ways?
discordant code follows immediately below:
Private Sub TrackSite_Click()
Dim Response As Integer
On Error GoTo Err_TrackSite_Click
Dim stDocName As String
Dim strWhere As String
If Me.StartDate Is Not Null And Me.StopDate <> #1/1/1899# Then
stDocName = "Patients on Follow-Up"
strWhere = "[FollowUp] Between #" & _
Forms![Tracking Print]![StartDate] & _
"# And #" & Forms![Tracking Print]![StopDate] & "#"
DoCmd.OpenReport stDocName, acViewPreview, , strWhere
Else
Response = MsgBox("You have failed to enter valid dates. Review and
correct your entries.", vbOKOnly + vbCritical, "Error")
End If
Exit_TrackSite_Click:
Exit Sub
Err_TrackSite_Click:
MsgBox Err.description
Resume Exit_TrackSite_Click
End Sub