populating subform from a single combo box

  • Thread starter bhrosey via AccessMonster.com
  • Start date
B

bhrosey via AccessMonster.com

Please help! I have a limited knowledge of VBA, so please make this a simple
as possible. Thanks in advance.
I have 2 questions:
1. I have a form called Parts Lookup with a combo box called cboPartName. I
also have on this form a subform(in datasheet view) that has part location,
part description, manufacturer, Qty in Stock, etc.. I want to be able to
pull up part name from the combo box and have it populate the subform. The
reason I'm using a datasheet for the subform is that when I select, for
example a bearing, there are several bearings to choose from and I want them
all to show up on the datasheet subform.
2. I am pointing to my table called Parts to get my list for the combo box,
how do get it to only show "bearings" once instead of a whole bunch of times?


Thanks so much!
Bill R.
 
A

Arvin Meyer [MVP]

Good question.

cboPartName is probable using the wrong table. You should have a table of
PartsCategories which would include bearings. If not, build one, and use the
PartsCategoryID in the Parts table, instead of bearings which is a repeating
value that's easy to misspell. The example at:

http://www.accessmvp.com/Arvin/Combo.zip

uses list boxes instead of a combo and subform, but it has exactly the code
you need.
 

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