BarryMK
4 strings are enough
- Local time
- Today, 08:38
- Joined
- Oct 15, 2002
- Messages
- 1,350
I'm opening a form based on a query. The OpenForm filters the query.
I'd like to put in a warning Msgbox if there are no records to display and stop the form from opening but I can't work how to do it.
RecordsetClone brings an invalid reference to RecordsetClone error
and
I'd like to put in a warning Msgbox if there are no records to display and stop the form from opening but I can't work how to do it.
RecordsetClone brings an invalid reference to RecordsetClone error
Code:
If Me.RecordsetClone.RecordCount = 0 Then
MsgBox "There are no current records logged for this service area", vbInformation, "No Records Found"
DoCmd.Close
stDocName = "frmSearch"
Else
DoCmd.OpenForm stDocName, , , "Archived = True"
and
Code:
DoCmd.OpenQuery "qryCPSearch", acViewNormal
If DCount("*", "qryCPSearch") = 0 Then
MsgBox "There are no current records logged for this service area", vbInformation, "No Records Found"
DoCmd.Close
Else
DoCmd.OpenForm stDocName, , , "Archived = True"
End If
Opens the form with no detail