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

CHANGE DATE/TIME FORMAT USING ALTER TABLE 1

Status
Not open for further replies.

jadams0173

Technical User
Feb 18, 2005
1,210
I add a column to my table using

Code:
DoCMD.RUN SQL "ALTER TABLE TEMP ADD RELTIME TIME"

Is there a way thru code to make the format of the new column short time?
 
Does it have to be SQL or would this suit (?):

Code:
Dim tdf As DAO.TableDef
Dim db As DAO.Database

Set db = CurrentDb

Set tdf = db.TableDefs("tblTable")
With tdf
    .Fields.Append .CreateField("RELTIME", dbDate)
    .Fields("RELTIME").Properties.Append .CreateProperty("Format", dbText, "Short Time")
End With
 
It doesn't have to be SQL. I'll give this a go!! Thanks Remou.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top