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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How can I change a fields Format property to "Short Time" using VBA?

Status
Not open for further replies.

Zygor

Technical User
Apr 18, 2001
271
0
0
US
I have a make table query that creates a new table everyday.

I have tried-

Dim tdf As DAO.TableDef
Dim fld As DAO.Field
Dim db As DAO.Database

Set db = CurrentDb

Set tdf = db.TableDefs("MyTableName")

Set fld = tdf.Fields("MtFieldName")

fld.Properties("Format") = "Short Time"

but it errors out on the last line with a Run Time error 3270 Property not found.

I have DAO 3.6 reference Library checked.


Thanks
 
Go to the Search. By typing fld.properties will return 50+ threads they should help.
 
That's how I got the above code. I checked other posts before I asked to see if anyone came across this problem.

Thanks for the quick reply.
 
Hi,

Your code worked OK in Access 2003. Are you sure that the field is a DATE type?

Simon.
 
A new table everyday?
Looks like a design flaw to me.

Moreover, the format property in a form or report overrides the format in the table, so that property should not be created/used in the first place.

If your users play around with the tables, you have a big problem.

HTH

[pipe]
Daniel Vlas
Systems Consultant

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top