BeforeUpdate - on Duplicate Cancel and Goto Duplicate Record

L

lucy

Hi,

I have a very simple form - one table one form. In my
Form_beforeupdate I check that it is not a duplicate entry (indexing is
not working for me, even though I have a 5 field unique index, if
there's a blank field it doesn't pick up on the duplication). If it is
a duplicate entry, I use a recordsetclone to move my form bookmark to
the recordset bookmark of the duplicate record. Everything works hunky
dory, until.....BeforeUpdate gets fired through this line in one of my
subs:

If Me.Dirty then Dirty=False

As soon as I return from the BeforeUpdate event I get error 3021, no
current record. If you click End, everything continues and works as it
should. It goes to the duplicate record and does whatever that sub was
doing. I can't trap this error and I can't seem to avoid it.

If the BeforeUpdate gets fired because say the user is moving to
another record all is fine, if there's a duplicate it pops a msg and
goes to the duplicate.

Anyone have ideas as to what the problem may be?

Thanks!
Jennifer
 

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