RE: Field Caption
- From: "Dave" <Dave@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Thu, 28 Jul 2005 15:27:04 -0700
"DennisGuilbault" wrote:
> Does anyone know how to get and set the caption property of a field in a
> table, using vba?
Dennis,
I was also looking to find out whether or not it was possible to set the
caption of the field in a table using VBA. Using Tim's response, even though
I didn't appreciate him lecturing about how "there was no logical reason for
doing this", I was able to get it done.
Try this code...
Sub FieldX()
Dim dbs As Database
Dim fld As Field
Dim prpCaption As Property
Set dbs = CurrentDb
Set fld = dbs.TableDefs("your_table").Fields("field_name")
Set prpCaption = fld.CreateProperty("Caption", dbText, "your_text_here")
On Error Resume Next
fld.Properties.Append prpCaption
dbs.Close
End Sub
Hope this helps you out.
Dave
.
- Prev by Date: RE: How do I use the INSERT INTO Statement in VBA?
- Next by Date: RE: How do I use the INSERT INTO Statement in VBA?
- Previous by thread: i cant open the window to microsoft office word viewer help
- Next by thread: Use a query in a code
- Index(es):
Relevant Pages
|
Loading