Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

change the format of field

Status
Not open for further replies.

Informatic

Programmer
Oct 4, 2002
34
DE
How can i Change the format of a field in a table with VBA Code.

Help .................
 
Hi

Do not know for sure but..

If you are using DAO

Try
Dim Db as Database
Dim Tdf as Tabledef
Dim fld as Fileds
'
Set Db = CurrentDb()
Set tdf = db.Tabledefs("TAbleName")
Set fld = tdf.Fields("fieldname")

now you need to experiment with properties of fld, (maybe .format) Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
Website needs upgrading, but for now - UK
 
Thanks...

I have already tried this but it doesn't work...

Maybe i have to do something with .CreateProperty


....
 
Hi

Yes, it is a property of the fied so:

Dim db As Database
Dim tdf As TableDef
Dim fld As DAO.Field
Dim i As Integer
Set db = CurrentDb()
Set tdf = db.TableDefs("tblName")
Set fld = tdf.Fields(1)
For i = 0 To fld.Properties.Count - 1
Debug.Print fld.Properties("Format")
Next i Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
Website needs upgrading, but for now - UK
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top