'dirty' question

G

Guest

greetings

I know that when a record is saved the dirty property is set to False, but
does setting the dirty property to false save the record?
 
D

Dirk Goldgar

In
Marshall Barton said:
Normally, it's a good idea to check if the record needs to
be saved.

If Me.Dirty Then Me.Dirty = False

I do that, too, but as far as I can tell, it just shaves some
infinitesimal amount of time off the statement if the form happens not
to be Dirty.
 
J

John W. Vinson

greetings

I know that when a record is saved the dirty property is set to False, but
does setting the dirty property to false save the record?

Yes. I'll often use a snippet like

If Me.Dirty Then
Me.Dirty = False
End If

to force a save.

John W. Vinson [MVP]
 
M

Marshall Barton

Becky said:
I know that when a record is saved the dirty property is set to False, but
does setting the dirty property to false save the record?


Yes.

Normally, it's a good idea to check if the record needs to
be saved.

If Me.Dirty Then Me.Dirty = False
 
M

Marshall Barton

Dirk said:
I do that, too, but as far as I can tell, it just shaves some
infinitesimal amount of time off the statement if the form happens not
to be Dirty.


I was wondering about that. Don't have time to set up
whatever experiments would be needed to verify that the
record isn't saved even when it's not dirty. Probably a
Before/AfterUpdate MsgBox would ... That's too easy to avoid
with the no time excuse. OK, the BeforeUpdate doesn't fire
unless the current record really is dirty and I can't
imagine any other side effect. Gotta have a little faith
that the developer that added the dirty = false feature
would do a decent job. Thanks for the kick in the butt Dirk
;-)
 

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