PDA

View Full Version : VBA Wildcard



scubaman
07-31-2014, 12:02 PM
I have an access table which needs to be renamed and uploaded to an access db every month. See below. I am able to rename the table but the last part (month) of the table changes every month. I there a way to rename this table using a wildcard? "Seizure lines thru *"

Public Function Renametable() As Object

Dim dbs As Database
Set dbs = DBEngine.OpenDatabase("c:\seizures\nancy\nancy.mdb")
Dim tdf As TableDef
Set tdf = dbs.TableDefs("Seizure lines thru june")
tdf.Name = "FY09 SASCOM"
dbs.Close
End Function

Thanks..

ranman256
08-01-2014, 12:30 PM
You should NEVER rename a table. None of the programs/queries will work.
Copy an existing permenant name to your new name table.

scubaman
08-03-2014, 08:54 AM
You should NEVER rename a table. None of the programs/queries will work.
Copy an existing permenant name to your new name table.

How would I copy it to a new table when the table name (month) changes every month? I know I can manually do it but I am trying to get away from that.