Closing Access application problem

jbotts

Registered User.
Local time
Yesterday, 16:51
Joined
Jun 8, 2009
Messages
22
Hi all,
I have a form with a combobox. The combobox displays a table field. When the form opens it displays the appropriate field of the first record in the table. If, using the combobox to look up a different record all works as planned. I have a user defined close button on the form which works just fine. However, if the user clicks on the application close button in the right upper part of the screen, I get a message back that the record cannot be saved because of a key violation. It seems the application close button is trying to enter a new record into the database. Any help would be appreciated.

jbotts
 
sure thing. can you attach you db file here so I can see it. it is much faster that way.
 
This is my first experience with this forum. I cannot see how to attach the file in a reply.
Jim
 
ok. when you are going to reply, click the advance instead of quick reply. then scroll down and you will see "manage attachments" button. click that and follow instructions.
 
Marianne,
Attached is the file with one record only to protect privacy of those entered in the database.
 
It bounced. Evidently it is too large.
 
What aspect of the database do you want to see?
 
ok. anyway if your problem is you want to disable the close button of your ms access windows not the forms or report then,

just unzip and import these files to your codes and on click or on load event of any of your form you want these codes to execute.
 

Attachments

When I unzip the file is a .cls extension and upon opening in MS Access 2003 it states it is an unrecognized database format
 
Merianne,
I solved the problem. The combobox was bound via a control source property. Once I cleared the property, the problem was solved. Thanks for your help.
Jim Botts
 
you found it yourself!

if you show record selectors in your form, you will probably see what is happening.

you may have a current event that immediately makes a record dirty, by setting a field/control to some value. if you are on a new record, you are probably having some mandatory fields, which do not contain default values

in which case the record selector will show a pencil rather than a black triangle.

now because the record is dirty, when you save it, access tries to save any edited record - but you get the warning message, and the record doesnt save, because of problems with the record.
 

Users who are viewing this thread

Back
Top Bottom