George Too
Registered User.
- Local time
- Today, 01:39
- Joined
- Aug 12, 2002
- Messages
- 198
Hello All,
Can anyone tell me why the following code is closing the database? This code sits behind the After Update event of a combo box:
Private Sub cmbDefect_AfterUpdate()
On Error GoTo RptErr
'Search for claims in the Film_Claims DB
If Me.cmbDefect = "Curl Issues" Or Me.cmbDefect = "Wrinkles" Then
DoCmd.OpenForm "frmFilmComplaintInvestigation"
Cancel = True
End If
RptErr:
If Err = 2501 Then
Resume Next
End If
End Sub
The form that opens up (frmFilmComplaintInvestigation) has the following code on its On Open event:
Private Sub Form_Open(Cancel As Integer)
If Me.RecordsetClone.EOF Then
MsgBox "No film complaints were found based on the criteria you entered."
Cancel = True
End If
End Sub
When executed, if no records are found I should get the message (which I do), but when I press on 'OK' the database closes up.
What's going on?
Thanks,
George
Can anyone tell me why the following code is closing the database? This code sits behind the After Update event of a combo box:
Private Sub cmbDefect_AfterUpdate()
On Error GoTo RptErr
'Search for claims in the Film_Claims DB
If Me.cmbDefect = "Curl Issues" Or Me.cmbDefect = "Wrinkles" Then
DoCmd.OpenForm "frmFilmComplaintInvestigation"
Cancel = True
End If
RptErr:
If Err = 2501 Then
Resume Next
End If
End Sub
The form that opens up (frmFilmComplaintInvestigation) has the following code on its On Open event:
Private Sub Form_Open(Cancel As Integer)
If Me.RecordsetClone.EOF Then
MsgBox "No film complaints were found based on the criteria you entered."
Cancel = True
End If
End Sub
When executed, if no records are found I should get the message (which I do), but when I press on 'OK' the database closes up.
What's going on?
Thanks,
George