Add form property description

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
 
B

Brendan Reynolds

Watch out for newsreader line-wrap ...

CurrentDb.Containers("Forms").Documents("Form1").Properties.Append _
CurrentDb.Containers("Forms").Documents("Form1").CreateProperty( _
"Description", dbText, "My New Form")
 
M

Marshall Barton

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")
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top