470,648 Members | 1,640 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,648 developers. It's quick & easy.

Combo box and option group for filtering records for table input

I have an ordering form that use two combo boxes to filter down the
records of a Products table. This worked fine with the after_Update of
the first filtering the records and creating the rowsource of the
second combo. The second combo's control source is the Product ID field
(foriegn key) on the Orders table.

Everything worked well until I decided to enhance the form by changing
the second combo to an option group. Now I don't know how to use both
of the controls to filter down the Products table records to get the
appropriate record (ID field - Primary key) and insert it into the
Product ID field (foreign key) of the Orders table.

I have created a properly working SQL INSERT INTO / SELECT statement
that gets the right data but can't get it to insert it into the table.

As an alternative I created a select query that works properly but
don't know how to get the output of the query into the table. I guess
it's a similar problem.

Any help would be appreciated.

May 23 '06 #1
1 3613
There's no very convenient way to use an option group to represent a
variable list of items, such as a list of Products. The value for each
option button must be either set manually (a true grind and impractical if
the list could EVER change) or in code (requiring some naming rules or very
tidy tag use and still impractical if the list could EVER change).

If you want to see all the products at once, use a ListBox insteadof a
ComboBox. Then you still get your live list of products, but you can select
just like an option group, just by clicking on the desired value. The
ListBox, of course, differs from the ComboBox primarily in the display (list
for listbox versus single textbox for combobox until opened). So, your
listbox can still be bound to the ProductID field and the whole app works
almost identically to the way it did before. In fact, the only likely
change is that you might name the listbox differently form the combobox.
Otherwise, no difference.
May 23 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Alex | last post: by
1 post views Thread by The Eclectic Electric | last post: by
1 post views Thread by Korara | last post: by
reply views Thread by warner | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.