using combo box and button to select a form

V

VV4yn0

I have built a database for a a group of stores - each store has its own
table and a form to add the data - this makes over 50 forms - I wanted a
simple interface to choose which store/form to open - I want to use a combo
box which lists the stores to select the store and then a button to open the
form (the form name and store names are the same)
So, to illustrate - combobox on left which allows you to select the name of
the store/form then a button on the right to actually open the form that was
selected.
I cant seem to link the button to open the selected form - I can (using the
wizard) build a button to open each form but then I need a bazillion buttons.
What am I missing?
Thanks for any help
Wayne
 
R

Rick Brandt

VV4yn0 said:
I have built a database for a a group of stores - each store has its
own table and a form to add the data - this makes over 50 forms - I
wanted a simple interface to choose which store/form to open - I want
to use a combo box which lists the stores to select the store and
then a button to open the form (the form name and store names are the
same)
So, to illustrate - combobox on left which allows you to select the
name of the store/form then a button on the right to actually open
the form that was selected.
I cant seem to link the button to open the selected form - I can
(using the wizard) build a button to open each form but then I need a
bazillion buttons. What am I missing?
Thanks for any help
Wayne

You need to use the OpenForm method feeding the name of the form from your
ComboBox...

DoCmd.OpenForm Me.ComboBoxName...

Of course if the table structures and forms are the same or very similar per
store then you have a very flawed design. In that case there should be one set
of tables with a field for the store name and exactly one form used for all
stores (much simpler). All you do then is filter the form for the desired
store's data.
 
V

VV4yn0

Rick Brandt said:
You need to use the OpenForm method feeding the name of the form from your
ComboBox...

DoCmd.OpenForm Me.ComboBoxName...

Of course if the table structures and forms are the same or very similar per
store then you have a very flawed design. In that case there should be one set
of tables with a field for the store name and exactly one form used for all
stores (much simpler). All you do then is filter the form for the desired
store's data.
I guess this is the problem of working it out as you go....
All the tables and forms are almost identical, just the store names change -
So I should have one table with columns for each of the columns my myriad of
tables have and just filter the ones I want for a particular store? - I
guess that the form should work the same way?
Incidently, I tried the string (DoCmd.OpenForm Me.ComboBoxName) with the
combo box's name substituted but can't seem to find where to put it without
generating an error.
Thanks for your help,
It seems I may be going back to the drawing board :)
Wayne
 
Top