Run Time error 2046 Command action save record
error '2046' message on a save button option?
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
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
close the application with report page open
I have the report screen open. If I just want to quit the application from this stage(Access 2007) without closing tabs at the top, Access will give me an error:
"Command or Action 'SaveRecord' isn't available now.
Run-time error '2046'
I'm not trying to save any record or anything and I am just trying to get out of the application when a report is open.
Requery a form from its subform, then add new
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
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?
Run-time Error '2046' when using DoCmd.RunCommand acCmdCopy whilst browsing records
I have a simple form in access.
There is one field on the form , DocID, which has the name of a document. When the form is loaded, I want the docID to be copied onto the clipboard so the user can paste this into another program without having to do a manual keyboard or mouse routine. After doing the copy, it moves the focus to the next field where a user could paste his results.
So, for the oncurrent event I wrote:
'copy the doc id value to the clipboard
'Move focus to DocID1 field
This works great if you acutally work with the record. No problems. The problem arises when/if the user scrolls through the records, instead of updating the record. Then I get the error:
Run-time Error '2046':
The command or action 'copy' isn't available now.
When I hit debug, it goes to the line: DoCmd.RunCommand acCmdCopy
Can anyone help me figure out why this doesn't work when you are browsing/scrolling through the recordset
OutputTo & 2046 Error - Revisited
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.
How to email several reports in pdf format to several recipients
I have several reports that I have made in access (2010) with it's reporting tool. What I would like to do is to send each of these reports off in an email to there corresponding departments. Sounds simple enough already huh?? Well I have the email function in place so that is finished but now what is happening is when I try to save the reports off in pdf format so they can be attached to the emails. I get a run time error, a "2046 The command or action 'Output To' isn't available now. I attempted to solve this by putting a "DoEvents" after the OutputTo and it continued to throw the same error. I then proceeded to make a timer function to cause the subroutine to "pause" for a few seconds and it worked for the first report but when the second report tried to produce BANG the same error.
For some background on what I am trying to accomplish here. I have a table that contains the PersonnelName, email, cc, subject respectively and are all text fields. The code calls a recordset to "lookup" the respective fields and produce an email with the report attached. I am not so worried about saving the report as attaching it to the email to be sent out as this is done daily. Oh I should probably mention this is all done by clicking a command button. So how would I go about producing the pdf for attachment?
Error 2046 when exporting a report from 2010 Runtime
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
'Copy' isn't available now...?
I have a form with a vba programmed button. It has been working fine for a while, but I came to use it today and it came up with the following:
Run-time error '2046':
The command or action 'Copy' isn't available now.
The only thing I have changed is that I have added a bit of tried & tested "timer" code around the original code - but I can't see how that would stop it from working!
The code I have is is a simple, open -> copy -> close:
DoCmd.Close acTable, "TblJdeWeeklyDetailTEMP"
The error highlights the 3rd line when you run the debug
Is a form Read Only
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
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.
Test a macro by using Single Step mode
By single stepping (single stepping: A debugging technique that enables you to run a macro one action at a time or run Visual Basic code one line at a time.) through a macro (macro: An action or set of actions that you can use to automate tasks.), you can observe the flow of the macro and the results of each action (action: The basic building block of a macro; a self-contained instruction that can be combined with other actions to automate tasks. This is sometimes called a command in other macro languages.), and isolate any action that causes an error or produces unwanted results. (Applies to Microsoft Office Access 2007)
save last record in table through a form
I have a form where I want to run the save record command behind a button. the problem is that the command only works if the button is in the record areas of the form (e.g. - detail section). the table will have 5 records in it when I want to save the last record.
question - how would I save that particular record (the last one) from the button if it is located in the form's footer
Email Form Run-time error '2501'
I have a button which attaches a report to an email so that the message and address can be edited.
There is no issue with that except if the user decides to close the message without sending the report, Access gives an error. Is there anyway to hide that error?
I am using the DoCmd.SendObject command and the error that is displayed is:
Run-time error '2501':
The SendObject action was canceled.
Spell Check not working
I have attached my database and pasted the code below. for some reason I keep getting the following error message:
'Run time error '2046' - The command or action 'spelling' isn't available now'
Here is the code:
Private Sub CmdSpellChecker_Click()
ControlEnabler True (These modules are arrays which set the Enabled /
ControlLocker False (Locked properties of the controls)
If Len(.Value) > 0 Then
.SelStart = 1
.SelLength = Len(.Value)
.SelLength = 0
Action on record before PK is created (record saved)
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?
Getting Run-time error '2501' - The RunSQL action was canceled
I am getting this error- 2501 when I try to press the 'Add Record' button when the form is incomplete. At that point I get this pop-up that says:
MS Access cvan't append all the records in the append query.
Do you want to run the action query anyway ?
When I press No, then I get the 2501 error.
Does anyone know how to handle or trap this error.
I want the functionality that when the incomplete form is being submitted to be entered in the table, then it should warn the user instead of showing this error. I have also attached the screenshots of the pop-up and the error 2501.
Hiding Navigation Pane kills macro
My title says it all. I want to have a nice looking user interface so I followed the advice found on the internet and hid it and deselected it in Access options - and it looks fine. however when I call a macro from a certain form I get Error 2046 (the command or action is not available now)!
Would someone please volunteer how to hide that navigation pane for appearance and security reasons but still have the macros work
Saving Duplicate ID Causes Runtime Error
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"?