Dirty not picking up new record

J

Jonathan

I have an Access 2003 database where a user starts a new record. I have code
on the form that checks to see if a new record has been started in the close
event:-

If me.dirty then
ValidateRecord
end if

Unfortunatelty the code isn't picking up that a new record has been created
when the user goes File|Exit, which leaves blank records in the database.
 
D

Dirk Goldgar

Jonathan said:
I have an Access 2003 database where a user starts a new record. I have
code
on the form that checks to see if a new record has been started in the
close
event:-

If me.dirty then
ValidateRecord
end if

Unfortunatelty the code isn't picking up that a new record has been
created
when the user goes File|Exit, which leaves blank records in the database.


In the Close event? By the time the form's Close event fires, the record
has already been saved. Validation of a record should take place in the
form's BeforeUpdate event.
 

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