I am using VBA, how do you test for new record in a form

U

Umar

What should I test my VBA code so that I know the User is working with record
as New in a Form. I am using Access 2007 under Windows XP.

I used PrimaryID as an auto generated number, therefore it is Null in the
begining that is how I know the user is trying to add a new record and not
editing an existing one.

So I test for IsNull(PrimaryID) which works if the user do not make mistake
but as the user enter more information made mistakes and need to correct the
PrimaryID is no longer Null. So my test passed as if the use is editing the
existing record when in fact the user is trying to add a new record.

Any help is appreciated.
 
U

Umar

Simply use Me.NewRecord if it is true then it is a new record, regardless how
many times the user has re-enter the information.
 

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