Add form property description

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I was able to create a description for a table created dynamically using vba
with something like:

Set tdf = dbs.CreateTableDef(MyTableName)
dbs.TableDefs.Append tdf
Set prp = tdf.CreateProperty("Description", dbText, "Some Description")
tdf.Properties.Append prp
dbs.TableDefs.Refresh

The table's property description becomes visible in the database window.

I want to be able to do something similar for a form created dynamically
through VBA.

The form is created with:

Set frm = CreateForm
'...lots of code in here to add form controls...
' ...etc...

' Set the form's property description:
??????????

The CreateProperty method is not available to forms, nor can you append a
property as you can with tables... Any ideas what to use?

Thanks
Ric
 
Watch out for newsreader line-wrap ...

CurrentDb.Containers("Forms").Documents("Form1").Properties.Append _
CurrentDb.Containers("Forms").Documents("Form1").CreateProperty( _
"Description", dbText, "My New Form")
 
ricm said:
I was able to create a description for a table created dynamically using vba
with something like:

Set tdf = dbs.CreateTableDef(MyTableName)
dbs.TableDefs.Append tdf
Set prp = tdf.CreateProperty("Description", dbText, "Some Description")
tdf.Properties.Append prp
dbs.TableDefs.Refresh

The table's property description becomes visible in the database window.

I want to be able to do something similar for a form created dynamically
through VBA.

The form is created with:

Set frm = CreateForm
'...lots of code in here to add form controls...
' ...etc...

' Set the form's property description:
??????????

The CreateProperty method is not available to forms, nor can you append a
property as you can with tables... Any ideas what to use?

After the new form is squared away, you can get to it's
ptoperties using this chain of objects:

CurrentDb.Containers!Forms.Documents(strformname).Properties("Description")
 
Back
Top