Keep in mind, this will cause an error if the form is not dirty to begin
with, so
If Me.Dirty = True Then
Me.Dirty = False
End If
is typical.
There are other ways to do DoCmd.RunCommand .... but the constants change
between Access versions and I find the code to be cryptic, so I always stick
with the Form's Dirty property.
You could also replace "Me" with a valid reference to a different open form:
Actually, Me.Dirty = False will not cause an error if the form isn't
dirty. It's just that it's marginally more efficient to only do that
when the form is actually dirty.
Actually, Me.Dirty = False will not cause an error if the form isn't
dirty. It's just that it's marginally more efficient to only do that
when the form is actually dirty.
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.