By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,224 Members | 1,143 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,224 IT Pros & Developers. It's quick & easy.

having to alter variable names in an existing table

P: n/a
I know this is bad.
SO I am copying the tables and wanted to ask can I use altertable to
modify the variable names. Every variable will just have the last 3
chrs of the table name appended to them.
something like this
JoinDate will become JoinDate_3DL
QuitDate will become QuitDate_3DL
Aug 12 '08 #1
Share this Question
Share on Google+
2 Replies


P: n/a
sparks wrote:
I know this is bad.
SO I am copying the tables and wanted to ask can I use altertable to
modify the variable names. Every variable will just have the last 3
chrs of the table name appended to them.
something like this
JoinDate will become JoinDate_3DL
QuitDate will become QuitDate_3DL

Sub asfd()
Dim tdf As TableDef
Dim fld As Field
Dim d As Database
Set dbs = CurrentDb
Set tdf = dbs.TableDefs("YourTableName")
For Each fld In tdf.Fields
fld.Name = fld.Name & "123"
Next
Set tdf = Nothing
End Sub

Touch
http://www.youtube.com/watch?v=rXewtL_kX4k
Aug 12 '08 #2

P: n/a
Salad thats too easy.

thanks I was trying to make it too hard

On Tue, 12 Aug 2008 15:15:23 -0700, Salad <oi*@vinegar.comwrote:
>Sub asfd()
Dim tdf As TableDef
Dim fld As Field
Dim d As Database
Set dbs = CurrentDb
Set tdf = dbs.TableDefs("YourTableName")
For Each fld In tdf.Fields
fld.Name = fld.Name & "123"
Next
Set tdf = Nothing
End Sub
Aug 13 '08 #3

This discussion thread is closed

Replies have been disabled for this discussion.