using two combo boxes on one form

  • Thread starter kknowles via AccessMonster.com
  • Start date
K

kknowles via AccessMonster.com

I have a form which has two combo boxes on it. The first combo box selects a
document number (say "cboDoc"), when a document is selected this box does two
things (via after-update macro); first it fills in about 10 text boxes on the
same form with related information to the document, second it filters and
requries the list for the second combo box. I have recently got this working
perfectly.

My problem is with the second combo box (say "cboItem") which is populated
with a list of item numbers pertaining to the chosen document. This combo box
selects an item number from the filtered list and fills in about 4 text boxes
on the same form with related information to the item. The problem is that no
matter which item number i choose from the second combo box, it always
selects the first item number (say the list has item 1, 2, 3, 4, 5 and i
choose item 4 - when the drop down list closes, item 1 is highlighted, and
the 4 text boxes on the form display the info for item 1.

I am unsure as to what the problem is because the second combo box should
work exactly like the first one, I use a macro (gotocontrol, findrecord) the
same way that i did for the first one.

This may sound confusing, and im not sure if ive provided enough info. but
any suggestions would be appreciated!
 
O

OfficeDev18 via AccessMonster.com

Since the two combobox results are interrelated, don't populate any textboxes
at all after updating the combobox1. Only populate combobox2's source and
requery it. After updating combobox2, then query the data using a compound
WHERE clause (combobox1=x and combobox2=y format) and populate all the
textboxes simultaneously.

Hope this helps,

Sam
 
K

kknowles via AccessMonster.com

Thanks for the suggestion OfficeDev, I tried what you said, and now the text
boxes all get updated at the same time (after the selection from cboItem is
made) however the item is still always the first one. It seems like there is
a binding problem, however, i have checked and tried binding this several
different ways with no success.

Im sure that all of the tables are linked properly, because if i select any
of the text boxes, i can scroll with the mouse wheel and get all the correct
info for each item...but this isnt very user-friendly at all, there must be a
way to choose it through a list (combo box).
Since the two combobox results are interrelated, don't populate any textboxes
at all after updating the combobox1. Only populate combobox2's source and
requery it. After updating combobox2, then query the data using a compound
WHERE clause (combobox1=x and combobox2=y format) and populate all the
textboxes simultaneously.

Hope this helps,

Sam
I have a form which has two combo boxes on it. The first combo box selects a
document number (say "cboDoc"), when a document is selected this box does two
[quoted text clipped - 18 lines]
This may sound confusing, and im not sure if ive provided enough info. but
any suggestions would be appreciated!
 
O

OfficeDev18 via AccessMonster.com

I should have thought of that before! Make sure your combobox2 Control Source
is blank (unbound). Only the Row Source property should have something in it.
That will probably clear up your problem.

Sam
Thanks for the suggestion OfficeDev, I tried what you said, and now the text
boxes all get updated at the same time (after the selection from cboItem is
made) however the item is still always the first one. It seems like there is
a binding problem, however, i have checked and tried binding this several
different ways with no success.

Im sure that all of the tables are linked properly, because if i select any
of the text boxes, i can scroll with the mouse wheel and get all the correct
info for each item...but this isnt very user-friendly at all, there must be a
way to choose it through a list (combo box).
Since the two combobox results are interrelated, don't populate any textboxes
at all after updating the combobox1. Only populate combobox2's source and
[quoted text clipped - 11 lines]
 
K

kknowles via AccessMonster.com

The control source for both of my combo boxes is blank (unbound), each is
based only on a row source.
 
O

OfficeDev18 via AccessMonster.com

I'm pretty much at the end of my rope on this. The only other thing I can
suggest is to make sure the combobox2 Row Source Type property is set to
Table/Query. Otherwise, make sure you don't have any VBA code or Macro code
lurking around that's forcing a value into the combobox.

Sorry I haven't been too helpful,

Sam
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top