Multiple Search boxes

A

Adam

Hi,

I have a form with a subform, master/child linked.

I've got 4 unbound combo boxes at the top of the form that
are used to search for records. The records show up in the
subform.

Each combo box serves a specific search purpose. Combo1
shows the list of Customer IDs sorted ascending, Combo2
shows the list of First Names sorted alphabetically,
Combo3 shows the list of Surnames alphabetically. Combo4
is for phone number. So I can search by Id, Firstname or
Surname, Phone No. or Combination thereof.

Is it possible to say select a particular customer and
have the other details corresponding to the selection put
into the other combo boxes once I've made a selection?

For example if I want to search for Joe Bloggs, I drop
down the surname list and it shows CustID, FirstName,
Surname, Phone (ie 4 cols, bound to 3 ordered on Surname),
scroll down to the Bloggs and click to select. Doing this
just puts Bloggs in the surname combo box. And, used by
itself, it returns all Bloggs. To filter out a specific
Bloggs, other criteria are needed. So, I'd like to be able
to have the Id, Firstname and Phone number put into the
other search criteria boxes at the time of selection.

Can this be done?

Many thanks for your assistance.

Adam
 
G

Gerald Stanley

You can access the other selected information through the
Column property. Try putting code along the following
lines in the AfterUpdate event handler for Combo3

Combo1.value = combo3.column(0)
Combo2.value = combo3.column(1)
Combo4.value = combo3.column(3)

Hope That Helps
Gerald Stanley MCSD
 
A

Adam

Hi,

Works well. Thanks for that.

Just a point though, those indices are not easy to play
with! Particularly if the drop-down list is in an
inappropriate order.

Adam
 

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


Top