How to know what is the action?

N

Nuno Gomes

Hello,

I need help. I thing is simple...

I have a form with some code in form_before_update to validate some entries.

One of the validation is test the duplication in the key field.

My problem is that message appears allways when i change my record.
There's something way to test what action the access is making?
So if the action is change record, i don't test the duplication of key
field...

Hope you understand..


Thank you,
 
K

Klatuu

Only perform the check for duplicates when you are entering a new record:

Private Function Form_BeforeUpdate(Cancel As Integer)

If Me.NewRecord Then
'Check for duplicates code goes here
End If
 

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