Add needs to change to update, how?

M

mscertified

I have a bound form that is used to modify existing records or add new
records. Records have a secondary index that is built from the data entered.
Records can also be active or inactive. Inactive records are never shown on
drop-down selection lists so users are unaware of them.
The problem occurs when the user requests to add a new record and unbeknown
to them there already exists an inactive record. I get a 'duplicate error' on
the secondary index. What I need to do is to intercept duplicate errors where
the record present is inactive and then flip the switch to 'active' whilst
merging the new data the user entered.
How can I do this since I have already executed 'DoCmd.GoToRecord , ,
acNewRec' on my form?
 
D

Dennis

Start with Me.Undo (cancels the add) and then execute code of your choice.
You could probably place the code in the form's Undo event, or just call it
from wherever you want.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top