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

CreateProperty Problems in BE table

Status
Not open for further replies.

EddyLLC

Technical User
Mar 15, 2005
304
US
I am using the following code portion to add a table to a backend database and then create a field named Fee 1 and set the properties, namely The Format property to Currency. I am getting a Data Type Conversion Error on the line in which I try to create the Format property. What am I missing?

Thanks.

Set db = OpenDatabase(DatabasePath)

' Create a new TableDef object.
Set tdfNew = db.CreateTableDef("Table1")

With tdfNew
' Create fields and append them to the new TableDef object. This must be done before appending the
' TableDef object to the TableDefs collection of the database.

'Add Field 1
Set tdfField1 = .CreateField("Fee!", dbCurrency)
.Fields.Append tdfField1
db.TableDefs.Append tdfNew
End With

Set wrkDefault = DBEngine.Workspaces(0)
Set dbsUpdate = wrkDefault.OpenDatabase(DatabasePath, True)
Set tdfUpdate = dbsUpdate.TableDefs("Table1")
With tdfUpdate
tdfField3.Properties.Append tdfField3.CreateProperty("Caption", dbText, "Fee 1")
tdfField3.Properties.Append tdfField3.CreateProperty("Format", dbCurrency, "Currency")
tdfField3.Properties.Append tdfField3.CreateProperty("Description", dbText, _
"Total Fee 1")
End With

Set wrkDefault = Nothing

 
Perhaps this ?
.CreateProperty("Format", [!]dbText[/!], "Currency")

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top