J
John Keith
Access 2003:
I have an add record form with a key field and several other fields.
Since the key is the only required field, I have a cmd button that runs this
statement: "DoCmd.Close acForm, Me.Name, acSaveYes" which saves the record
and closes the form then requeries a main form to show this new record in the
selection list.
When tabing off the form (instead of clicking the add record button) the
AfterUpdate event fires. I am thinking that my close form and requery code
should be in the AfterUpdate so there is one place to maintain this code.
How do I make the btn click routine cause the form to be updated and thus
fire the AfterUpdate event? (duplicating the same code in both places
(Addbutton_click and AfterUpdate)) throws an error that says the form close
event was canceled.
I have a cancel button that runs Me.Undo which will cancel the form changes;
I need the Me.DoTheSave command code...
Perhaps there a DoCmd that will accomplish this? Seems messy to just code
around the if form is not open in the AfterUpdate event.
I have an add record form with a key field and several other fields.
Since the key is the only required field, I have a cmd button that runs this
statement: "DoCmd.Close acForm, Me.Name, acSaveYes" which saves the record
and closes the form then requeries a main form to show this new record in the
selection list.
When tabing off the form (instead of clicking the add record button) the
AfterUpdate event fires. I am thinking that my close form and requery code
should be in the AfterUpdate so there is one place to maintain this code.
How do I make the btn click routine cause the form to be updated and thus
fire the AfterUpdate event? (duplicating the same code in both places
(Addbutton_click and AfterUpdate)) throws an error that says the form close
event was canceled.
I have a cancel button that runs Me.Undo which will cancel the form changes;
I need the Me.DoTheSave command code...
Perhaps there a DoCmd that will accomplish this? Seems messy to just code
around the if form is not open in the AfterUpdate event.