By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,508 Members | 2,949 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,508 IT Pros & Developers. It's quick & easy.

run time error 2046

100+
P: 434
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. Does anybody know what I'm missing that would give me this error. If you need further information let me know.
Thanks for any help.
May 30 '12 #1

✓ answered by dsatino

Well, I guess if it isn't 'available now', see if it's available later.

Try moving it out of the open and into the current() event.

Share this Question
Share on Google+
12 Replies


ADezii
Expert 5K+
P: 8,600
Do you have any Code residing in any of the Form's Events, specifically: Open(), Load(), Current()?
May 31 '12 #2

100+
P: 434
Yes the code is in the Open() event
Expand|Select|Wrap|Line Numbers
  1. DoCmd.GoToRecord , , acNewRec
I have the program on my desktop computer and the same program works great on it. I just copies the program and the database from the desktop to the laptop after I installed the Access 2007 program.
May 31 '12 #3

dsatino
100+
P: 393
Check your references in the VBA editor for anything 'missing'.
May 31 '12 #4

100+
P: 434
I've checked the references and there are no errors. That was the first thing I checked when I got this error. I've also check the trust locations to make sure everything is setup there. I have this running on another computer and I checked the references there to the references on the laptop and everything is the same.
May 31 '12 #5

100+
P: 759
Check the database (the file) again.
Maybe the file has a "Read Only" attribute.
That happen if you use Nero (for example) to burn a CD then copy the information from the CD in the PC.
May 31 '12 #6

100+
P: 434
I've also checked that and it's not read only, I've also check the permissions to make sure that everything was allowed. Like I said I've checked the laptop against the desktop where it is running and everything looks the same. I'm at a loss
May 31 '12 #7

dsatino
100+
P: 393
Well, I guess if it isn't 'available now', see if it's available later.

Try moving it out of the open and into the current() event.
May 31 '12 #8

100+
P: 434
Ok I tried your suggestion and moved the open event to the current event I got other errors but the docmd worked. I then when ahead and moved the statements back to the Open event and guess what!!! Everything is now working. So just by removing the Open event and then setting it back up fixed what ever problem there was. I don't understand but everything is now working. At least everything I've tested. Thanks for all your help
May 31 '12 #9

dsatino
100+
P: 393
just out of curiousity, is the file type .mdb or .accdb?
Jun 1 '12 #10

100+
P: 434
The program is Access 2007 and the application is the accdb.

Again thanks for all your help. I wish I understood why just removing the Open event and then setting it back up again did the trick.
Jun 1 '12 #11

dsatino
100+
P: 393
Well, during these events (open, load, etc) the program is running certain processes. By allowing programmers access to these events, the program is allowing us to add additional processes in. My guess is that there is some sort of additional information that allows your add-in to the process to be run and that information was lost. By killing your piece and then re-creating it, you re-created the lost info as well.
Jun 1 '12 #12

100+
P: 434
Well that makes sense, again I've learned something new. Next time I have a funny problem I'll try the redoing the process. Again thanks.
Jun 1 '12 #13

Post your reply

Sign in to post your reply or Sign up for a free account.