Hi all im trying to do what i thought was an easy task, but i keep getting an error.
All i want to do is on a button click open a new form and close the form im on, the form i open is for a query that could have no data, so instead of getting the run time error i just want a little message box saying no data found, can anyone tell me whats going wrong.
Option Compare Database
Private Sub GreenFilter_Click()
On Error GoTo err_NoDataFound
DoCmd.OpenForm "FrmMissingData", acNormal, , , acFormEdit, acWindowNormal
DoCmd.Close "Form1", acSavePrompt
Exit_NoDataFound:
End Sub
err_NoDataFound:
MsgBox ("No Data Found")
Resume Exit_NoDataFound
End Sub
All i want to do is on a button click open a new form and close the form im on, the form i open is for a query that could have no data, so instead of getting the run time error i just want a little message box saying no data found, can anyone tell me whats going wrong.
Option Compare Database
Private Sub GreenFilter_Click()
On Error GoTo err_NoDataFound
DoCmd.OpenForm "FrmMissingData", acNormal, , , acFormEdit, acWindowNormal
DoCmd.Close "Form1", acSavePrompt
Exit_NoDataFound:
End Sub
err_NoDataFound:
MsgBox ("No Data Found")
Resume Exit_NoDataFound
End Sub