What is the difference?

  • Thread starter Thread starter Derek Brown
  • Start date Start date
D

Derek Brown

Hi all

To carry out an immediate update to tables when entering data into a form I
had been using:

DoCmd.RunCommand acCmdSaveRecord
DBEngine.Idle dbRefreshCache
DoEvents

When I programmatically enter data into a form it was suggested that I use:

Forms!NameOfForm.Dirty = False

Is there any difference and if so what

Many thanks!!
 
In the first 3 lines that you have, the equivalent command to "Me.Dirty =
False" is the first line, "DoCmd.RunCommand acCmdSaveRecord".

Theoretically, there shouldn't be a difference between the two command.
However, the "Me.Dirty = False" tends to have fewer problems creep in. Also,
the DoCmd commands act on the item that has the focus. So, if another form
received the focus for some reason then it would receive the action of the
DoCmd call. The "Me.Dirty..." command can also be modified to be called from
another location, such as a standard module, by replacing "Me" with
"Forms!FormName".
 
Friend,

joel-ange sitbon has invited you to join GreenZap and get $50 WebCash to
spend online. Sign up for a FREE GreenZap account and get $50 to spend at
hundreds of the world's premier merchants, many of whom are offering
incredible upfront discounts. Click on the link below to go to GreenZap and
signup! All thanks to joel-ange sitbon.

It's Zappening in the GreenZap Storez.
http://www.greenzap.com/joel1962

If you do not want to receive these emails in the future click the link
below:
http://www.greenzap.com/optout_invite.asp
 
Thats great thank you


Wayne Morgan said:
In the first 3 lines that you have, the equivalent command to "Me.Dirty =
False" is the first line, "DoCmd.RunCommand acCmdSaveRecord".

Theoretically, there shouldn't be a difference between the two command.
However, the "Me.Dirty = False" tends to have fewer problems creep in.
Also, the DoCmd commands act on the item that has the focus. So, if
another form received the focus for some reason then it would receive the
action of the DoCmd call. The "Me.Dirty..." command can also be modified
to be called from another location, such as a standard module, by
replacing "Me" with "Forms!FormName".
 
Back
Top