K
Keith
Use the VB Editor window to add a line as follows:
Docmd.Close acform, Me.Name
The line should be added immediately after the save
command line of code and before any exit or error handler
label (you can spot those because the line ends in a
colon ))
That can give problems if there are data entry errors
(like a critical field missing or something), so an
alternative is to add the line of code into the
AfterUpdate event for the form. That way it will never
try to close if there is an error, since it will never
get to the After Update event unless the save operation
works correctly.
Docmd.Close acform, Me.Name
The line should be added immediately after the save
command line of code and before any exit or error handler
label (you can spot those because the line ends in a
colon ))
That can give problems if there are data entry errors
(like a critical field missing or something), so an
alternative is to add the line of code into the
AfterUpdate event for the form. That way it will never
try to close if there is an error, since it will never
get to the After Update event unless the save operation
works correctly.