Avatar of Jagwarman
Jagwarman asked on

access 2010 error the command or action save record isnt available now

Would an Expert be able to throw any light on this er

the command or action save record isn't available now

thanks
Microsoft Access

Avatar of undefined
Last Comment
Jagwarman

8/22/2022 - Mon
Gustav Brock

You are most likely about trying to save a record while you still are editing it.

/gustav
ASKER
Jagwarman

Hi Gustav, I don't think so. I had everyone close their Access down. I then went into the record and got the error.
Gustav Brock

You didn't tell much so I thought it was a coding question.
Still, something is locking the table.

Copy the backend to a local folder, relink to this. If the error is gone, you may face a network issue.

/gustav
Your help has saved me hundreds of hours of internet surfing.
fblack61
ASKER
Jagwarman

Unfortunately I am not an Access Expert so I don't know how to do what you suggested :-(
Gustav Brock

If everyone is sharing the same file on the server, copy that file to a local folder and run it from there.

If that works, study the on-line help on the wizard that splits a database into two, a backend on the server and a frontend with everything else, located on the workstations.

/gustav
PatHartman

When you get the message, press cntl-break to stop the code.  Post the procedure (including the header).
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.
ASKER
Jagwarman

did that Gustav but I get the same error.

When I go into tables I can see the record has changed from closed to open having been amended despite the error saying it has not been saved
Gustav Brock

So it is a coding issue. Follow the advice from Pat.

/gustav
ASKER
Jagwarman

do you mean this

Private Sub acMainOpenClosedStatus_AfterUpdate()
DoCmd.DoMenuItem acFormBar, acFile, acSaveRecord
End Sub

or this

Run-time error '20-46';

The command or action 'SaveRecord' isn't available now.
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23
Gustav Brock

If acMainOpenClosedStatus is your form, you have just updated this.
Then there is nothing to save, thus the error.

Can't you just remove the DoCmd. .. command?

/gustav
ASKER CERTIFIED SOLUTION
PatHartman

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
See how we're fighting big data
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
Nick67

The times that I most commonly run into that error is when I have code like
DoCmd.DoMenuItem acFormBar, acFile, acSaveRecord
and I have breakpoints on as I am stepping through the code.
The command then tries to execute when the code windows is the focus, and things go BANG!

Now, that clearly isn't what your problem is, but the idea is related.
Whenever the SaveRecord command would be greyed out on the toolbar\Ribbon, if your code issues that command, it'll go BANG! (in my case, trying to save the record when the code window is the active object makes no sense and I get a BANG!)

Now, even though the button wizards still (Still!) create that kind of code, it's old-school Access 97 compatible.
These days, the syntax should be
DoCmd.RunCommand acCmdSaveRecord

That still won't help if the command would be greyed out by circumstances.
What the code is trying to tell you is that all the prerequisites for saving a record aren't present yet.
What type of control is acMainOpenClosedStatus and what other controls must have values in them before you can save a record?  Are there ALWAYS a set of circumstance where you can get the error to occur?
ASKER
Jagwarman

Looks like mine is one of those rare cases. Thanks.
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.