DoCmd.Rename

G

Guest

Have been beating my head against the desk because I can't get this to work -

DoCmd.Rename "OldTableName", acTable, "NewTableName"

Always get back the following:

"Run-time error '3270': Property not found."

My workaround - DoCmd.CopyTable ,

Always returns:

"Run-time error '2486': You can't carry out this action at the present time."

I'm dyin' here. Anyone got a suggestion?
 
D

Dirk Goldgar

mdw said:
Have been beating my head against the desk because I can't get this
to work -

DoCmd.Rename "OldTableName", acTable, "NewTableName"

Always get back the following:

"Run-time error '3270': Property not found."

My workaround - DoCmd.CopyTable ,

Always returns:

"Run-time error '2486': You can't carry out this action at the
present time."

I'm dyin' here. Anyone got a suggestion?

You've got the parameter sequence wrong; it should be:

DoCmd.Rename "NewTableName", acTable, "OldTableName"

But I don't see why you would get that particular error, instead of one
about "table not found". Where and when are you trying to execute this
statement?
 
D

Dirk Goldgar

mdw said:
Have been beating my head against the desk because I can't get this
to work -

DoCmd.Rename "OldTableName", acTable, "NewTableName"

Always get back the following:

"Run-time error '3270': Property not found."

My workaround - DoCmd.CopyTable ,

Also, there is no DoCmd.CopyTable method, so that can't be the real code
you're executing. Maybe you mean CopyObject, but it's really hard to
debug code that isn't quoted correctly.
 
G

Guest

See how jacked I am? Couldn't even post the issue correctly...

DoCmd.Rename NewTableName, acTable, OldTableName

and as you stated -

DoCmd.CopyObject , NewTableName, acTable, OldTableName.

Thanks, and sorry for the confusion...

m
 

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