![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Dim db As Database Dim td As TableDef Dim pr As Property Set db = CurrentDb Set td = db.CreateTableDef(TechName) With td .Fields.Append .CreateField("ID", dbLong) .Fields.Append .CreateField("Name", dbText, 50) .Fields.Append .CreateField("Value", dbText, 100) .Fields.Append .CreateField("Type", dbText, 20) 'Add properties (doesn't work) -> .Properties.Append .CreateProperty("Version", dbText, "1.00a") pr = .CreateProperty("x", , "123") ' <== Error occurs here |
|
'Append the new TableDef object to the database. db.TableDefs.Append td End With |
#3
| |||
| |||
|
|
ACCESS 97 When I want to add a property to a newly created table I get the error: "Object or With variable not set" Any suggestions on what is wrong with the line where I want to add the property? This is the code: Dim db As Database Dim td As TableDef Set db = CurrentDb Set td = db.CreateTableDef(TechName) With td .Fields.Append .CreateField("ID", dbLong) .Fields.Append .CreateField("Name", dbText, 50) .Fields.Append .CreateField("Value", dbText, 100) .Fields.Append .CreateField("Type", dbText, 20) 'Add properties (doesn't work) -> .Properties.Append .CreateProperty("Version", dbText, "1.00a") 'Append the new TableDef object to the database. db.TableDefs.Append td End With |
![]() |
| Thread Tools | |
| Display Modes | |
| |