combo box vba help

ashleydkennedy

New member
Local time
Today, 09:05
Joined
Feb 7, 2002
Messages
5
Does anyone know how to build a combo box that references the various forms/or tables in the database. I want to have a combo box or list box where the user can pick a form and then the form opens (basically for navigation).

Thanks in advance
 
Use this code as the Row Source for you Combo to show Forms:

SELECT [MSysObjects].[Name] FROM MSysObjects WHERE (Left([Name],1)<>"~") And ([MSysObjects].[Type])=-32768 ORDER BY [MSysObjects].[Name];

And this to show Tables:

SELECT [MSysObjects].[Name] FROM MSysObjects WHERE (Left([Name],1)<>"~") And ([MSysObjects].[Type])=1 ORDER BY [MSysObjects].[Name];
 
Make a table with two columns 1. Actual name of Form you want to open & 2. Descriptive alias of Form. Base your combo box on this table and set bound column to first column and displayed column to second. In After Update of combo box use ...

DoCmd.OpenForm cboForm_to_Open

... to pass the value of the bound column

HTH
Chris
 
Chris,

I like your idea, could you elaborate on the code a bit more because after trying what you said an error kept occuring. How do I open the correct forms from the combo box?

Thanks
Ash
 

Users who are viewing this thread

Back
Top Bottom