THANKS! This appears to be just what I need. I'm executing this:
DAOdbs1.TableDefs.Append MyTabledef
Set obj = MyTabledef.Fields
strPropertyName = "Format"
intType = dbText
varValue = "General Date"
strErrMsg = ""
Call fncSetPropertyDAO(obj, strPropertyName, intType, varValue, strErrMsg)
to get my format changed, BUT...
I get an error:
"Object doesn't support this property or method"
I used this:
Dim prpNew As Property
Dim prpLoop As Property
With DAOtbldef
' Create and append user-defined property.
Set prpNew = .CreateProperty()
prpNew.Name = "Description"
prpNew.Type = dbText
prpNew.Value = strLinkTableDesc
.Properties.Append prpNew
End With
as my example. I use this code to create a description on the linked table (for
the database window), that I pull from the internal ODBC table. (I'll switch
over to yours, once I get it to work.)
I changed:
Set obj = MyTabledef.Fields
to:
Set obj = MyTabledef
and the error went away, but I also didn't get the format for my date field
changed to "General Date". (It was empty/unchanged).
Since this is in my temp backend, is there anything special I need to do? (I
used "DAOdbs1", rather than "DAOdbs").
Sorry to ask for more help, but I'm still trying to get all the objects,
properties and methods straight in my head.
Thanks again,
Tom
Oh yeah, is "dbText" reserved? I ask, because before starting this thread, I
had tried setting it up as type string. And VB didn't like it.
And how should I dim SetPropertyDAO? Object? Integer? Right now I have it
defined as a global object.