P
Paul3rd
Hello, I have written the following code to cancel a load event under certain
circumstances. The code will fire the MsgBox but I can't figure out how to
cancel the Load event.
Any help would be greatly appreciated.
Paul
Private Sub Form_Load()
Dim rst As Object
Dim strCriteria As String
If Me.Text41.Value = 1 Then
MsgBox ("Form Currently in use...try again later")
DoCmd.CancelEvent
Else
strCriteria = "[ApptDate] = #" & Date & "#"
Set rst = Me.RecordsetClone
rst.FindFirst strCriteria
If Not rst.EOF Then
Me.Bookmark = rst.Bookmark
End If
End If
End Sub
circumstances. The code will fire the MsgBox but I can't figure out how to
cancel the Load event.
Any help would be greatly appreciated.
Paul
Private Sub Form_Load()
Dim rst As Object
Dim strCriteria As String
If Me.Text41.Value = 1 Then
MsgBox ("Form Currently in use...try again later")
DoCmd.CancelEvent
Else
strCriteria = "[ApptDate] = #" & Date & "#"
Set rst = Me.RecordsetClone
rst.FindFirst strCriteria
If Not rst.EOF Then
Me.Bookmark = rst.Bookmark
End If
End If
End Sub