Selecting a list from a list (sort of.....)

PrincessBretti

Registered User.
Local time
Today, 16:43
Joined
Mar 16, 2000
Messages
14
Hi,
I have a combobox which enables me to select surnamess from my database, and another combobox which selects firstnames. At the moment when I select the first names the entire list from the database appears for me to select from. I wish to limit the firstnames to match the surnames ie:
if I select:
Surname Smith
I want only those firstnames listed who have the surname 'Smith'
for instance
Fred and Joe rather than 4000 other names!
If anyone can help I'd be really greatful, or you could just reply and laugh at my crummy explanation of the problem. Oh well nevermind
wink.gif


(princess)Brett(i)
 
Brett(i),

Possibly the easiest way for you to do this is as follows:

Combobox1 (Surnames), The column that has the surnames should be the 'bound' column, the column with the data that you want to pass on.

Combobox2 (firstname), You want to base this combobox on a query with say 3 fields

[Unique ID],[Surname],[Firstname]

In the criteria section of the [Surname] field on the query you need to type:

[Forms]![yourformname]![Combobox1name]

inserting the name of your form and combobox where necessary.

Combobox2 should have 2 columns [Unique ID] and [Firstname] the bound column being the [Unique ID]if you want to open a form or report to do with that particular person.

In addition to all this in the 'After update' properties section of combobox1 you need to insert some code in the module like:

Combobox2.requery

This means that when you select a new surname in combobox1, combobox2 will update to show the firstnames that relate to that surname.

Hope this is of some help.
 

Users who are viewing this thread

Back
Top Bottom