Topics Search

Run Time error 2046 Command action save record

Run Time error 2046 Command action save record
Views: 170
I have a frmCustomerEntry on which customer information is entered. After completing the information, the operator presses the Check In command button on frmCustomerEntry. At this point I am trying to save the customer information so it will be available when frmCheckIn is opened.

When the check In button is clicked, I am getting a run time error 2046. The command or action ‘Save Record’ isn’t available.
Sponsored Links:

Similar posts...

 

error '2046' message on a save button option?

error '2046' message on a save button option? Icon
I created a save button with options to either save the record yes or no. When I click on no option the following error message appears. "Run Time error '2046': The command or 'Undo' isn't available now", However when I click yes nothing happens. Why has this occurred and how can I hide this message?
 

run time error 2046

run time error 2046 Icon
I had to rebuild my laptop, I've reloaded my Access 2007 restored my database and program, I've checked all the references and have setup the trust locations. But when I go to open one of the forms I get this error 2046 with the message The command or action "gotorecord" isn't available now.
 

Run-time error 2046 the command or action "DeleteRecord" isn't available now

Run-time error 2046 the command or action "DeleteRecord" isn't available now Icon
Run-time error 2046 the command or action "DeleteRecord" isn't available now
 

Requery a form from its subform, then add new

Requery a form from its subform, then add new Icon
I have a form with a subform with no navigation buttons. The subform has a cmdSave button to save the detail record. In its click event I have

If Not Me.NewRecord Then RunCommand acCmdRecordGoToNew
Me.Parent.Requery

Depending on the order of these two statements I get a different problem.

If I use the order shown, the RecordGoToNew works but it is effectively undone by the requery. If I add another RecordGoToNew line I get error 2046: The command or action 'RecordGoToNew' isn't available now.

If I switch order I receive the 2046 error.

It seems that a requery prevents the GoToNew from working.

So far I have avoided doing the requery at all but how do I introduce it without creating a problem?
 

OutputTo & 2046 Error - Revisited

OutputTo & 2046 Error - Revisited Icon
I first tested it with a standalone macro. Once working, I created some code to execute the macro from a form with the database window hidden.

The macro worked fine. I then have tried to run the command from vba (so that I may easily alter the output location and file name on the fly).

I'm stuck on the 2046 error. Thinking there might be a problem with the variable stDocName, I tried the the report name as a quoted string --still get the error.
 

Error 2046 when exporting a report from 2010 Runtime

Error 2046 when exporting a report from 2010 Runtime Icon
I have a small reporting database in Access 2010 that does nothing but run a report and export it to PDF. This is called by a Windows Task each day and works perfectly, well almost. I haverecently had cause to need to run this report from a PC that has Access Runtime (also 2010) and on that machine the export reliably fails.

The error that is recorded (I write errors to a table rather than display them on the screen) is Error 2046 - "The command or action'OutputTo' isn't available now."

(where fileName = "C:\Reports")

DoCmd.OutputTo acOutputReport, "RptFinal", acFormatPDF, fileName, 0

Yet it works fine on a number of PC's with the full version of Access. If I change the windows task on the PC using full access to call Access using the runtime switch, it fails there as well. But remove the runtime switch and it's fine.

We are using Windows XP SP3 and Office 2010 SP1
 

Is a form Read Only

Is a form Read Only Icon
I have an application that has one of several forms that depending upon the User's name, can be opened as either Read-Only, Add or Edit mode.

Is there an easy way to check within the form when it is open whether it is Read-Only or Edit mode?

My need for this is to avoid a 2046 error 'SaveRecord' isn't available now as I do need to force save (Docmd.RunCommand.AcCmdSaveRecord) the record before Closing when it is in Edit mode.

I have looked around and seen some suggestions based around the AllowEdit property but that is not the solution. Using acFormOpenDataMode enumeration looked interesting too but that to seems not to be the answer either.

I have managed a work around that uses a check on the same User's name as part of an IF statement as to whether to run the save command code.

Essentially I suppose this is the same process as checking IF formname = readonly then close else save then close but I feel we need to get to the nub of the problem rather than a workaround
 

Access 2007 macro RunCommand

Access 2007 macro RunCommand Icon
I have a Macro that in the old version I had several things going on like SetWarnings, Open and Close 2 queries then OpenModule and its command is MailMod and next statement was RunCommand with a command of Run

When I run the macro it loops through 20 times and give me a error that a Macro can only call itself a maximum of 20 times.

If I run the Bat file I get a error that The command or action “Run” isn’t available now.
 

Action on record before PK is created (record saved)

Action on record before PK is created (record saved) Icon
I have a situation where I have a "Click to add" function on a subform that lists records in another table. As the last record in the subform, it's listed as "New" instead of "Edit".

I have an open form command with a where "[ID]=" & Nz([ID],0) statement.

This works well. The problem is that when the subform opens, and data is entered, I have a command button to start a procedure based on the PK ([ID]). Since no ID exists yet (assigned onsave), the function requiring the PK reports no valid PK.

I have attempted to insert an

if me.dirty then me.dirty=false

but then it replaces the data in the form with #deleted and give me a write conflict error when I attempt to save the record again (close form).

How do I save the record to assign the PK in [ID] and then pass that value to the functions that require it?
 

Saving Duplicate ID Causes Runtime Error

Saving Duplicate ID Causes Runtime Error Icon
My form has a command button to allow me to save a record. Whenever I save a duplicate record I get a runtime error that throws me into debug mode. How can I keep this from happening andperhaps just have a standard, "you can't save this record because it will cause a duplicate"?