If I hardcode the table names, the code runs. However, I need to use varibles for table names. What is the proper syntax to be able to use variables?
Thank you.
Private Sub Command18_Click()
Dim tblFileName_BU2 As String 'old table
Dim tblFileName_BU3 As String 'new table
newtable = tblFileName_BU3
oldtable = tblFileName_BU2
DoCmd.Rename newtable, acTable, oldtable
End Sub
----- OR -------
This works but I need variables....
Private Sub Command19_DblClick(Cancel As Integer)
DoCmd.CopyObject , "tblFileNames_BU1", acTable, "tblFileNames_BU2"
End Sub
Thank you.
Private Sub Command18_Click()
Dim tblFileName_BU2 As String 'old table
Dim tblFileName_BU3 As String 'new table
newtable = tblFileName_BU3
oldtable = tblFileName_BU2
DoCmd.Rename newtable, acTable, oldtable
End Sub
----- OR -------
This works but I need variables....
Private Sub Command19_DblClick(Cancel As Integer)
DoCmd.CopyObject , "tblFileNames_BU1", acTable, "tblFileNames_BU2"
End Sub