Ferociously Simple Combo Box Frustration

O

oftenly

Yes, I'm extremely new to access, and yes, I'm stupid, so I'll try to
be brief:

I have a table for a number of companies. The fields are:
ID (primary key)
Company Name
Contact Name
Phone Number
Fax Number

I also have a form, obviously, with a bare-bones query attached to
it. At the top of the form I have my combo box, and below I have
three text fields. My combo box is populated with the company names,
and when I select a company from the list I want the three text fields
to update with the appropriate contact name, phone number and fax
number, respectively.

I understand that I can attach a "requery" command to the "after
update" event of the combo box, but my problem is in knowing how to
manipulate the query, so to speak. I've found that the data produced
by the selection is the primary key of that record, but that
revelation isn't helping me. Where is it stored and subsequently made
available to the query? The options in the wizard are either store it
in a field (what? why would I want to do that? I have no need to
save the data anywhere) or "remember the value for later
use" ("remember"? so what do I tell my query? "don't worry query,
you'll remember where the data is..."). All the tutorials i've read
so far end after you hit "finish" on the combo box wizard; they don't
explain how you USE the combo box and the data associated with the
selection you make.

I feel this is one of the simplest things one could ask of access, and
frankly I'm stunned by my inability to figure it out. Could the kind
people of the internet offer some advice?

Thanks.
 
A

Arvin Meyer [MVP]

The easiest way is to include the fields in your combo box, then set the
control source = to the corresponding column index (zero based)

= Forms!FormName!cboComboName.Column(2)

for the Contact Name

= Forms!FormName!cboComboName.Column(3)

for the Phone Number

= Forms!FormName!cboComboName.Column(4)

for the Fax Number
 

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

Similar Threads

Populate combo box from current record 3
combo box filter 1
Combo Box 2
Blank combo or list box 1
Combo Box Values 5
Combo box trouble 1
Trouble with combo box 1
Change displayed combo box value using VBA 4

Top