N
Neil
Hello All,
I posted this question yesturday and Jeff kindly responded with the answer
below. However, my original problem still remains. Even after making my
second form a modal dialog, if the user selects that they want to continue
ammending the record (without undoing changes) then this message box
annoyingly appears. I really need to supress this message and then catch the
errors in the main forms unload event and then cancel the unload (if
necessary). In the Error event for the form, I can set the response and I
dont get the message box. Only thing with this is the changes are
automatically undone. Anyone know how to stop this message from appearing???
TIA,
Neil.
Also, the custom pop-up form is modal so you can't interact with the main
form until the user selects an action (Undo & Close, Undo, Continue to
correct errors).
-----------------------------------------------------------------
Neil wrote:
Thanks for your input Jeff,
The form is Modal but can't be set to dialog. There is an option frame on
how to proceed and an OK button. If the form is dialog then the user cant
change anything in the option frame. Maybe my only work around is to replace
the option frame with command buttons.
Thanks,
Neil.
Jeff wrote:
Neil originaly wrote:
Hello All,
I have a problem with Access 2002. In the BeforeUpdate event of my form, I
have a procedure which loops through all the controls on my form. If any
fields that are required are left blank, I cancel the event and bring up
another form which displays the reason why the event was cancelled and gives
the user an option to undo or return to the main form and continue. This
works great until the user clicks on the close button in the main form. I
then get the Access DataErr 2169
Microsoft Access
You can't save this record at this time.
Microsoft Access may have encountered and error while trying to save a
record.
If you close this object now, the changes you made will be lost.
Do you want to close the object anyway?
Yes No
The form that I open has the functionality of this message box (and gives a
better description of what is wrong and how to correct it) and I would like
to display that instead. I have tried coding the Form_Unload event to do
this but the message box above appears before the Unload event executes. I
have also tried coding the Form_Error event to catch this error and try to
supress the message but can't seem to get that to work either. Does anyone
have any sugestions as to how I can get this to work properly?
TIA,
Neil.
I posted this question yesturday and Jeff kindly responded with the answer
below. However, my original problem still remains. Even after making my
second form a modal dialog, if the user selects that they want to continue
ammending the record (without undoing changes) then this message box
annoyingly appears. I really need to supress this message and then catch the
errors in the main forms unload event and then cancel the unload (if
necessary). In the Error event for the form, I can set the response and I
dont get the message box. Only thing with this is the changes are
automatically undone. Anyone know how to stop this message from appearing???
TIA,
Neil.
Also, the custom pop-up form is modal so you can't interact with the main
form until the user selects an action (Undo & Close, Undo, Continue to
correct errors).
-----------------------------------------------------------------
Neil wrote:
Thanks for your input Jeff,
The form is Modal but can't be set to dialog. There is an option frame on
how to proceed and an OK button. If the form is dialog then the user cant
change anything in the option frame. Maybe my only work around is to replace
the option frame with command buttons.
Thanks,
Neil.
Jeff wrote:
Jeff Boyce said:Neil
Is there a chance you don't open the pop-up message form in "dialog" mode?
It sounds a little like the user can still see the main form's <Close>
button, and can still select it.
Perhaps trying to close a main form (and save a record) when the
BeforeUpdate code is still running (i.e., the pop-up isn't closed yet) is
causing your problem?
--
Good luck
Jeff Boyce
<Access MVP>
Neil originaly wrote:
Hello All,
I have a problem with Access 2002. In the BeforeUpdate event of my form, I
have a procedure which loops through all the controls on my form. If any
fields that are required are left blank, I cancel the event and bring up
another form which displays the reason why the event was cancelled and gives
the user an option to undo or return to the main form and continue. This
works great until the user clicks on the close button in the main form. I
then get the Access DataErr 2169
Microsoft Access
You can't save this record at this time.
Microsoft Access may have encountered and error while trying to save a
record.
If you close this object now, the changes you made will be lost.
Do you want to close the object anyway?
Yes No
The form that I open has the functionality of this message box (and gives a
better description of what is wrong and how to correct it) and I would like
to display that instead. I have tried coding the Form_Unload event to do
this but the message box above appears before the Unload event executes. I
have also tried coding the Form_Error event to catch this error and try to
supress the message but can't seem to get that to work either. Does anyone
have any sugestions as to how I can get this to work properly?
TIA,
Neil.