I have a form which runs the following code on the OnLoad event. However, I am getting an error message "The OpenForm action was cancelled" after the form closes.
I have tried using DoCmd.SetWarnings = False / True but this still does not stop the error message.
Dim rs As dao.Recordset
Set rs = Me.RecordsetClone
If rs.recordCount = 0 Then
MsgBox "No Invoices/Bookings are associated to this Name. Please try another search."
DoCmd.Close acForm, "frmAmendInvoiceList"
Any ideas please?