PC Review


Reply
Thread Tools Rate Thread

Dirty not picking up new record

 
 
Jonathan
Guest
Posts: n/a
 
      20th Jul 2009
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.


 
Reply With Quote
 
 
 
 
Alex Dybenko
Guest
Posts: n/a
 
      20th Jul 2009
Hi,
Try to use form's BeforeUpdate event to validate record + cancel it if not,
and then use unload event to save record and check if it still dirty

--
Best regards,
___________
Alex Dybenko (MVP)
http://accessblog.net
http://www.PointLtd.com


"Jonathan" <(E-Mail Removed)> wrote in message
news:A6112364-C693-4851-94D0-(E-Mail Removed)...
> 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.
>
>

 
Reply With Quote
 
Dirk Goldgar
Guest
Posts: n/a
 
      20th Jul 2009
"Jonathan" <(E-Mail Removed)> wrote in message
news:A6112364-C693-4851-94D0-(E-Mail Removed)...
>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.

--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
When does record become dirty? alex Microsoft Access 10 26th Feb 2010 02:50 PM
Save New Record that is not dirty rbeach Microsoft Access VBA Modules 2 3rd Feb 2010 10:12 PM
Picking up last record Sue Compelling Microsoft Access Queries 2 20th Feb 2009 03:04 AM
make a record dirty deb Microsoft Access 11 14th Nov 2008 07:05 AM
Re: New record or not Dirty Douglas J. Steele Microsoft Access Forms 0 13th May 2008 01:27 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:28 PM.