Hi:
I have a data entry form with several fields on it. Some fields have default values and can be edited if necessary, while others start out empty and require input.
A user can tab through the fields and enter information as necessary. When done with entering a record, the user has the option of tabbing through the last field to get a new record or clicking the CLOSE button to close the form.
If the user tabs through to add other records, the Form_AfterInsert() code ALWAYS runs. But, if the user doesn't want to enter more records, the CLOSE button is clicked and the Form_AfterInsert() code doesn't run ON ONLY THE LAST RECORD.
The code behind the CLOSE button is:
DoCmd.Close acForm, Me.NAME, acSaveYes
[Forms]![frmGapMenu].Visible = True
Shouldn't this be enough to INSERT the last inputted record into the table and for the Form_AfterInsert() code to run?
I'm very puzzled and frustrated by this one. Please help!
Jim DeGeorge
I have a data entry form with several fields on it. Some fields have default values and can be edited if necessary, while others start out empty and require input.
A user can tab through the fields and enter information as necessary. When done with entering a record, the user has the option of tabbing through the last field to get a new record or clicking the CLOSE button to close the form.
If the user tabs through to add other records, the Form_AfterInsert() code ALWAYS runs. But, if the user doesn't want to enter more records, the CLOSE button is clicked and the Form_AfterInsert() code doesn't run ON ONLY THE LAST RECORD.
The code behind the CLOSE button is:
DoCmd.Close acForm, Me.NAME, acSaveYes
[Forms]![frmGapMenu].Visible = True
Shouldn't this be enough to INSERT the last inputted record into the table and for the Form_AfterInsert() code to run?
I'm very puzzled and frustrated by this one. Please help!
Jim DeGeorge