Open form from Listbox

m kappler

Registered User.
Local time
Today, 14:19
Joined
Mar 14, 2005
Messages
13
I have a list box on a form with 10 items to
choose from. When a item is chosen I want
a form to open (OnOpen or OnLoad Event ??)
with a recordsource depending on one of the
10 items chosen in the list box.
The recordsource is an sql statement which
will change/depend on the item selected
The 10 items refer to 10 different tables.

Thanks for your help
 
Openform

Hi mtairhead

Thanks for that but that doesn't tell me how to
achieve that from clicking on the list box.
Could it be something like this

DoCmd.OpenForm Me.ListBox.Item2
then Forms!MyForm=Me.Recordsource = "Query1"

or could it be that I need to use the case statement
or something similar

Thanks
 
No.. On the DoubleClick event of the list box....
DoCmd.openform "yourotherformname",acnormal

On the on-open event for "yourotherformname", put in the code...

Me.RecordSource = "your list box string here"

As long as the options in the listbox are the names of tables in your database, I don't see why it wouldn't work...

Andrew
 

Users who are viewing this thread

Back
Top Bottom