i am trying to rename a table in access 2007 using form fields as variable in
DoCmd.Rename "Old Employees Table", acTable, "Employees"
I have the following code:
Private Sub Command7_Click()
Dim TableNew As String
Dim TableOld As String
Dim UpDate As String
Dim What As String
TableNew = Chr(34) & Me.Text5 & Chr(34) & ","
TableOld = Chr(34) & Me.text1 & Chr(34)
What = "acTable" & ","
UpDate = TableNew & " " & What & " " & TableOld
DoCmd.Rename UpDate
End Sub
my results are kinda wacky:
it renamed my table as follows:
"uhd002", actable, "uhd005"
where uhd002 is the value in form field me.text5 and udh005 is the value of form field me.text1 .
this is im sure a syntax snafu that i am braindead on.
any help would be apreciated