G
Guest
I get the error message "You canceled the previous operation." when I run the
following code. I can't see or understand why.
Private Sub cmdSchedules_Click()
On Error GoTo Err_cmdSchedules_Click
Dim stDocName As String
Dim strWhere As String
If IsNull(txtOStartDate) = -1 Then
MsgBox "You must enter at starting date!", vbInformation
txtOStartDate.SetFocus
Exit Sub
End If
Me.RecordSource = "SELECT * FROM RPTqryLearnerTop " _
& "WHERE StartDate = 'Me.txtOStartDate'"
strWhere = Me.RecordSource
stDocName = "rptOrientationSchedule"
DoCmd.OpenReport stDocName, acPreview, , strWhere
Exit_cmdSchedules_Click:
Exit Sub
Err_cmdSchedules_Click:
MsgBox Err.Description
Resume Exit_cmdSchedules_Click
End Sub
Thank you, Fay
following code. I can't see or understand why.
Private Sub cmdSchedules_Click()
On Error GoTo Err_cmdSchedules_Click
Dim stDocName As String
Dim strWhere As String
If IsNull(txtOStartDate) = -1 Then
MsgBox "You must enter at starting date!", vbInformation
txtOStartDate.SetFocus
Exit Sub
End If
Me.RecordSource = "SELECT * FROM RPTqryLearnerTop " _
& "WHERE StartDate = 'Me.txtOStartDate'"
strWhere = Me.RecordSource
stDocName = "rptOrientationSchedule"
DoCmd.OpenReport stDocName, acPreview, , strWhere
Exit_cmdSchedules_Click:
Exit Sub
Err_cmdSchedules_Click:
MsgBox Err.Description
Resume Exit_cmdSchedules_Click
End Sub
Thank you, Fay