Add needs to change to update, how?

  • Thread starter Thread starter mscertified
  • Start date Start date
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?
 
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.
 
Back
Top