change fieldnames in the table using VB

accessman2

Registered User.
Local time
Today, 08:59
Joined
Sep 15, 2005
Messages
335
Hi,

In Visual Basic language,

there are codes for createDef (generate the new table), right.

Can we update the fieldnames in the table?

I have one table with 3 fieldnames:
Name1, Name2, Name3

I want to write VB to edit the fieldnames in the table as following:
N1,N2,N3

Can VB edit it except generating the table?
I went through the forum, but I cannot get any ideas about it.
Does anybody have hints?

Thanks.
 
The following is from the help screen in the vba module

FieldName Property
See AlsoApplies ToExampleSpecificsYou can use the FieldName property to specify the name of a field within a table. For example, you can specify "Last Name" for a field that stores employees' last names within the Employees table.

Setting
Enter a field name, following Microsoft Access object naming rules. The name can't duplicate any other field name in the table.

Note Avoid specifying a name for a field that could cause a conflict with built-in Microsoft Access function or property names, such as the Name property.

You can set this property in the upper portion of table Design view or by using Visual Basic.

In Visual Basic, use the ADO Name property to read and set a table's field name.

Remarks
Microsoft Access identifies a field by its field name. Once you have specified a field name in table Design view, you can use that name in expressions, Visual Basic procedures, and SQL statements.
 

Users who are viewing this thread

Back
Top Bottom