G
Guest
I'm trying to rename a table in my current database using a module attached
to a command button, using the DoCmd object, like so:
Private Sub Befehl70_Click()
On Error GoTo Err_Befehl70_Click
DoCmd.Rename Application!CurrentData!AllTables!diff_gnl_old, acTable,
Application!CurrentData!AllTables!diff_gnl_new
DoCmd.OpenForm Pegel_edit, acNormal
Exit_Befehl70_Click:
Exit Sub
Err_Befehl70_Click:
MsgBox Err.Description
Resume Exit_Befehl70_Click
End Sub
In the database window, if I click on 'Tables' and rename diff_gnl_new to
diff_gnl_old, it works fine - I just need to confirm that I want to replace
the old version of diff_gnl_old, and it's done.
However, when I try to use my command button, with the above code in its
module, I get an error message saying that the 'object does not support this
feature or method' - or whatever the English translation is of the message
which I'm getting in German. Is it a problem with how I've referenced the
table in my code (I'm not an expert on the hierarchy of objects), or is there
something I need to add to my code?
Thanks
Mike M
to a command button, using the DoCmd object, like so:
Private Sub Befehl70_Click()
On Error GoTo Err_Befehl70_Click
DoCmd.Rename Application!CurrentData!AllTables!diff_gnl_old, acTable,
Application!CurrentData!AllTables!diff_gnl_new
DoCmd.OpenForm Pegel_edit, acNormal
Exit_Befehl70_Click:
Exit Sub
Err_Befehl70_Click:
MsgBox Err.Description
Resume Exit_Befehl70_Click
End Sub
In the database window, if I click on 'Tables' and rename diff_gnl_new to
diff_gnl_old, it works fine - I just need to confirm that I want to replace
the old version of diff_gnl_old, and it's done.
However, when I try to use my command button, with the above code in its
module, I get an error message saying that the 'object does not support this
feature or method' - or whatever the English translation is of the message
which I'm getting in German. Is it a problem with how I've referenced the
table in my code (I'm not an expert on the hierarchy of objects), or is there
something I need to add to my code?
Thanks
Mike M