Quick question

ogg13

Registered User.
Local time
Today, 10:50
Joined
Jan 30, 2007
Messages
49
I have a data entry form that has a bunch of text boxes bound to a table.

Currently, after a user enters their information, they click a button to save the record and certain info that was entered that would likely be used again for the next bit of data entry are auto populated into the text boxes. Behind the scenes, access automatically creates an incomplete record right off the bat with the information that is autopopulated.

This works good for what we do, however when someone tries to close the form, the user gets the standard canned message stating that duplicate entry would occur, blah blah blah.

The form is coded so that part of the information that autopopulates is the primary key fields as a check so that someone cant hit the button twice and save duplicate information.

Id like to find a way, only upon closing the form, to get rid of that 'half-entry' so to speak.

Is there any way to accomplish this through the method that I have set up, aside from disabling error messages?
 
Wasnt aware of its existance 8)

Ill give it a shot now. Thanks!
 
Well, I tried the me.undo method... It may work.. however its not being called at the right time and I cant figure out how to call it at the right time.

When the user clicks the close button on the form, it appears as though the error messages occur before the close event starts. Putting Me.undo clears all the fields, but only after the very message I want supressed fires off.

I guess they arent 'error messages' so to speak, they are access (not VBA) messages stating that there is a primary key violation and access cannot save the database object. At this point in time, the primary key violation is expected. Its what I use as a check, but the user doesnt need to see this information. Try as I may, I cannot find a way to suppress them for this instance in time.

Does anyone have any suggestion as to which keywords I can look up in the access VBA help system that may help me accomplish what I am hoping to do?
 

Users who are viewing this thread

Back
Top Bottom