Can I do this? Please help

bluenose76

Registered User.
Local time
Today, 00:44
Joined
Nov 28, 2004
Messages
127
Hi,

I have a Macro in my database that is used to clear the contents of a table and then subsequently fill the table from an external CSV file.

This is working absolutely great however i would like it to do a little mroe if it is possible?

I would like to have it so that after it has finished all of the above, it will then rename the columns in the table so that i dont have F1, F2 etc etc. if i rename them manually, then once i have run my macro they all return to default?

Please help and advise me on the best method of doign this?

Thank you
Bev
 
You would have to use the TableDef object in VBA to change the fields names.
 
KeithG said:
You would have to use the TableDef object in VBA to change the fields names.


Keith,
Thank you for your reply, I dont suppose there is an example of this anywhere?

This is now showing my lack of experience with Access, I have been using this for three years now and there is soo much more i need to learn.

Thank You

Bev
 
defs

currentdb.TableDefs("table1").Fields("OldFieldName").Name = "NewFieldName"


Hope this helps
 
Rickster,

Thank You for this I shall give it a go and see if i can get it working.

Regards
Bev
 

Users who are viewing this thread

Back
Top Bottom