error 2046 after ODBC connection

M

Michel Peeters

I have a db "PURCHASE" which worked OK.
I added following sub which starts with the Autoexec macro>function>StartDB
:

Sub StartDB()
DoCmd.CopyObject , "SUPcopy", acTable, "SUP"
DoCmd.DeleteObject acTable, "SUP"
DoCmd.TransferDatabase acImport, "ODBC Database",
"ODBC;DSN=VeniceConnection", acTable, "SUP", "SUP"
End sub


After running once above procedure the db gives
- when the command "Application.RunCommand acCmdSaveRecord" is started
somewhere in code - :
"error 2046: The command or action "REcordsGoToNew isn't available now"
The error remains after compressing and repairing the db.

When I a start with a blank db and import completely (tables, forms, etc...)
from PURCHASE but without the "StartDB" procedure it works again.
When I make the ODBC connection on the menubar (external data>import....)
and import the table the error does not occur (but the intention is to run
it automaticly when the db starts).

As soon as I add the StartDB procedure and run it the problem is there
again.

tks for helping.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top