I have virtually finished my database and have run into a slight glitch.
When adding a new record I need the form to close if do data is entered in the first field.
I have a check on LostFocus for the field which successfully deletes the incomplete record - but I cannot get it to then close the form.
Run-time error 2585
This action can't be carried out while processing a form or report event.
Clicking on Debug goes to the Close line in my code.
If IsNull(Me.ReqDate) Then
MsgBox ("No data entered - deleting record"
DoCmd.DoMenuItem acFormBar, acEditMenu, acUndo, , acMenuVer70
DoCmd.Close
End If
Any ideas gratefully received !
Jane
When adding a new record I need the form to close if do data is entered in the first field.
I have a check on LostFocus for the field which successfully deletes the incomplete record - but I cannot get it to then close the form.
Run-time error 2585
This action can't be carried out while processing a form or report event.
Clicking on Debug goes to the Close line in my code.
If IsNull(Me.ReqDate) Then
MsgBox ("No data entered - deleting record"
DoCmd.DoMenuItem acFormBar, acEditMenu, acUndo, , acMenuVer70
DoCmd.Close
End If
Any ideas gratefully received !
Jane