I have buttons on a form that run a query to filter the records and then open another form to display the records.
I just added the following code on the second form to show a "No Records Found" message when the query returns no records:
Private Sub Form_Load()
If Me.Recordset.RecordCount = 0 Then
DoCmd.Close
DoCmd.Close acQuery, "qryFrmQuickDE"
DoCmd.Maximize
MsgBox "No records found"
Else
DoCmd.Maximize
End If
End Sub
After adding the above code to the second form's Load event, the first form will no longer maximize. I have DoCmd.Maximize on the first form in the On Load, On Got Focus, On Open, On Resize and On Activate form events. I've tried adding DoCmd.Maximize to many of the other events with no luck.
Can anyone tell me how to get the first form to maximize after the "No Records Found" message box is closed?
I just added the following code on the second form to show a "No Records Found" message when the query returns no records:
Private Sub Form_Load()
If Me.Recordset.RecordCount = 0 Then
DoCmd.Close
DoCmd.Close acQuery, "qryFrmQuickDE"
DoCmd.Maximize
MsgBox "No records found"
Else
DoCmd.Maximize
End If
End Sub
After adding the above code to the second form's Load event, the first form will no longer maximize. I have DoCmd.Maximize on the first form in the On Load, On Got Focus, On Open, On Resize and On Activate form events. I've tried adding DoCmd.Maximize to many of the other events with no luck.
Can anyone tell me how to get the first form to maximize after the "No Records Found" message box is closed?