Problem updateing form after insert

johndoomed

VBA idiot
Local time
Yesterday, 17:16
Joined
Nov 4, 2004
Messages
174
Hi again. One other problem I got in my database is updating forms after inserting new data.

Example: I've made a system for sending invoices. Connected to the invoice is serveral order-lines which is shown in a subform (I use access in norwegian so I'm not sure about that name).

I've made another form for inserting these order-lines. The problem occurs when I close the insert-form, with macro. I cant get the invoice form to update. I have to click on a update-buttom (Macro: update)...

Can this be fixed as well?
 
I don't use macros so I don't know if there is a bug you are running into but I think the close method of a form has a bug that doesn't save the current record. It just closes and discards changes if any errors occur. You can solve the problem by forcing a save before closing the form. Sorry I don't know what the macro action is but the method is:

DoCmd.RunCommand acCmdSaveRecord
 
The macro action is "Save".
Assign the macro to OnCurrent event on the form that you are trying to update.
 
tkoh78,
The current event is not appropriate for this purpose. The current event fires whenever a form moves to a new record. The PREVIOUS record has already been saved if it was dirty and the CURRENT record has not yet had the opportunity to become dirty.

johndoomed,
The save action needs to be added to the macro that closes the form.
 

Users who are viewing this thread

Back
Top Bottom