Connecting Tech Pros Worldwide Help | Site Map

Combo box and option group for filtering records for table input

hackerslacker
Guest
 
Posts: n/a
#1: May 23 '06
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.

Rick Wannall
Guest
 
Posts: n/a
#2: May 23 '06

re: Combo box and option group for filtering records for table input


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.


Closed Thread


Similar Microsoft Access / VBA bytes