me.dirty = false deletes records

  • Thread starter Thread starter Tony Daniels
  • Start date Start date
T

Tony Daniels

I have been trying to move away from the doCmd to save
records, so that I could trap some errors. But much to
my horror, using that command is changing records to
##### or #Deleted.

Has anyone had this problem with Me.Dirty?

Thanks

Tony
 
No. We use consistently use:
Me.Dirty = False
as the best way to save the record.

I'm guessing there is some other factor at work in your issue.
 
Tony,

This happened to me once when I had Required set to yes in one of my fields
in my table. If the user didn't type any data into the field on the form,
the record would get deleted. I dont know if this is what is heppening with
you...?

Neil.
 
This is possible, there are required fields. What happens
to the before update event with this function?

Tony
 
Whenever the form tries to save a record (even when using Me.Dirty = False),
the BeforeUpdate event for the form will (or should :-)) fire. If I remember
correctly, In my case, I was messing arround with the warning messages at
the time so I may have accedently kept the warnings turned off. All I can
think of is that i didnt get a warning that a field was not filled - Access
then took over and didnt save the record (this then gave the illusion that
my record had been deleted!).

I always do my checking for required fields in the BeforeUpdate for the form
anyway and cancel the update if a field is left blank.

HTH,

Neil.
 
ah ha! I thought it was that.

And my girlfreind tells me I have a bad memory... or was it that I dont
listen to her... :-)

Neil.
 
Back
Top