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

Display form names in a combo box 1

Status
Not open for further replies.

Razor1

IS-IT--Management
Nov 21, 2002
81
US
I need to display form names that are contained in my database in a combo box. Any idea on how to do this.

Thanks in advance for any help.



Razor1
 
You can set the RowSource to:

SELECT [Name] FROM MsysObjects WHERE Type=-32768

Which takes advantage of a system table. Be aware that tampering with system tables can cause serious problems.
 
Caution, this will also display subforms. If you are attempting to provide application navigation functionality, I would take the time to create a table of form names and their friendier titles. I wouldn't want to expose my form names to users since they really aren't named for "human consumption".

Duane MS Access MVP
Now help me support United Cerebral Palsy
 
How are ya Razor1 . . .

[blue]Remou[/blue] has posted what you need, however [blue]dhookom[/blue] makes a good point in that subforms also show.

If you desire to [blue]exclude subforms[/blue] and in your naming convention you've prefixed or postfixed a common descriptor (say [purple]sfrm[/purple] as in [purple]sfrm[/purple]ClientDetails), then a [blue]Where[/blue] clause appended to [blue]Remou's[/blue] code will do the trick. Example:
Code:
[blue]SELECT Name
FROM MsysObjects
WHERE ((Left([Name],4)<>"[purple][b]sfrm[/b][/purple]") AND (Type=-32768))
ORDER BY Name;[/blue]

Calvin.gif
See Ya! . . . . . .

Be sure to see thread181-473997
Also faq181-2886
 
Thanks for the help.

I am able to isolate the form names to show only the ones I want the end user to see.

Thanks again.

Razor1
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top