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

Use of Description Property on Database Object

Status
Not open for further replies.

GeorgeDurkee

Programmer
Feb 22, 2000
47
US
When you right click on a database object, you can enter a description of what that object is. For example, an object named rptAssignmentsP can be given the description label All Assignments Report by Person, which means a lot more.<br>
<br>
I want to use this description in a drop down selection box for selecting a report, but can't seem to find the property setting that controls the acess to this.<br>
<br>
Anybody have any idea where this is hidden and how I can access it for use in my drop down?<br>
<br>
Thanks
 
Ask and you shall recieve:<br>
this is in Help, key in &quot;Object Properties Example&quot;<br>
Here are the results after I ran it. Description is the last item.<br>
---------------------<br>
Table2<br>
Name = Table2<br>
Owner = admin<br>
UserName = admin<br>
Permissions = 1048575<br>
AllPermissions = 1048575<br>
Container = Tables<br>
DateCreated = 2/14/00 12:35:56 PM<br>
LastUpdated = 2/22/00 2:13:31 PM<br>
OrderByOn = False<br>
Description = Sample Database<br>
<br>
-----------------------<br>
The following example uses the PrintObjectProperties subroutine to print the values of an object's Object properties to the Debug window. The subroutine requires the object type and object name as arguments.<br>
<br>
Dim strObjectType As String<br>
Dim strObjectName As String<br>
Dim strMsg As String<br>
<br>
strMsg = &quot;Enter object type (e.g., Forms, Scripts, &quot; _<br>
& &quot;Modules, Reports, Tables).&quot;<br>
' Get object type.<br>
strObjectType = InputBox(strMsg)<br>
strMsg = &quot;Enter the name of a form, macro, module, &quot; _<br>
& &quot;query, report, or table.&quot;<br>
' Get object name from user.<br>
strObjectName = InputBox(strMsg)<br>
' Pass object type and object name to<br>
' PrintObjectProperties subroutine.<br>
PrintObjectProperties strObjectType, strObjectName<br>
<br>
Sub PrintObjectProperties(strObjectType As String, strObjectName _<br>
As String)<br>
<br>
Dim dbs As Database, ctr As Container, doc As Document<br>
Dim intI As Integer<br>
Dim strTabChar As String<br>
Dim prp As Property<br>
<br>
Set dbs = CurrentDb<br>
strTabChar = vbTab<br>
' Set Container object variable.<br>
Set ctr = dbs.Containers(strObjectType)<br>
' Set Document object variable.<br>
Set doc = ctr.Documents(strObjectName)<br>
doc.Properties.Refresh<br>
' Print the object name to Debug window.<br>
Debug.Print doc.Name<br>
' Print each Object property to Debug window.<br>
For Each prp in doc.Properties<br>
<br>
Debug.Print strTabChar & prp.Name & &quot; = &quot; & prp.Value<br>
Next<br>
<br>
End Sub<br>
<p> DougP<br><a href=mailto: dposton@universal1.com> dposton@universal1.com</a><br><a href= > </a><br>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top