What is the error you get? Did you confirm that acCmdSaveRecord is a valid constant?
Error in VBA from DoCmd.RunCommand acCmdSaveRecord
We have moved to Access 2016 but are using databases created in Access 2003. We get an error when the VBA gets to the command:
DoCmd.RunCommand acCmdSaveRecord
So far, everything else seems to work okay.
Note: some of our computers are running Windows 7, Others are running Windows 10.
Why won't this command work? Is there a rational work-around?
Thanks
Microsoft 365 and Office | Access | For home | Windows
Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.
17 additional answers
Sort by: Most helpful
-
Tom van Stiphout 40,096 Reputation points MVP Volunteer Moderator
2020-01-14T03:33:22+00:00 I have seen that too recently. I replaced with:
Me.Dirty = False
and moved on, but did not understand what happened. Too stressed for time to really investigate. Thanks for posting; I will pay more attention I see it again, and hope to find a pattern. Please share any details you can find out. If you can create a reproducible scenario, that would be really helpful.
-
-
Anonymous
2020-01-14T04:10:46+00:00 Thanks, Tom. Sorry, but I fear that I am not nearly as advanced as you so don't fully understand your answer.
What does Me.Dirty = False do ?????????????
As for reproducing the error -- no problem --- it happens every time you reach that point in the program.
I can easily send you a copy of the code that causes the error but you won't be able to run it because it requires quite a few specific tables with specific fields to run.
FYI - I own a small company and started programming in Basic Language on a Radio Shack computer in 1967. I later moved to dBase II, then to FoxPro, then to Access in 2002. I have written most of the programming that we use to run our company (hundreds of Access databases) but the walls of my knowledge are very steep. I am very comfortable doing what I know how to do but if I take just a few steps beyond my knowledge, I fall into a pit.
I appreciate your help.
-
Anonymous
2020-01-14T04:32:35+00:00 The Dirty property has been documented in the help file:
https://docs.microsoft.com/en-us/office/vba/api/Access.Form.Dirty(property)
As I suggested, it is an alternative way to saving a record.
Just like Ctrl+S is, and probably half a dozen other ways.
The reason for my ask was to see if you could put together a minimal app with minimal tables, devoid of any PII, that you could share with the community or with me (and by extension with MSFT). We don't really want the whole app, just the minimal that can illustrate the problem.