Update form results using drop down box

M

M Shannon

I have absolutely no idea how to achieve this but am
looking for the following:

Lets say I have one table (person) with 4 fields;
Autonumber
First Name
Surname
Sex

I have a tabular form that displays all these records. In
the form header I have a drop down box that has records
male and female saved for later use.

What I would like is that when the user selcts male it
will only show the records in the table person, where sex
is male, and similar to when the user selects female.

All your help is much appreciated.
 
M

M SHannon

I'm not sure if that really helps me though.

I only have one combobox! I dont want to restrict what I
see in another combobox as I dont have one.

Lets look at it a different way. I have a huge list of
data in a tabular form. I have a drop down box that lists
numerous categories. When people use the drop down box,
it will filter the data in the form according to the
category they chose. The category is one of the fields
within the dataset as well.

Does that make sense at all?

Thanks in advance
 
T

Tom Ellison

Dear M:

There are two ways:

1. Alter the RecordSource of the form to follow the selection in the
combo box:

SELECT * FROM YourTable WHERE Gender = "M"

2. Have the RecordSource respect the combo box:

SELECT * FROM YourTable WHERE Gender =
[Forms]![YourFormName]![ComboBoxName]

Since either of these methods will work for either the RecordSource of
a form or the RowSource of another combo box, Dout's reply was in the
correct direction.

Tom Ellison
Microsoft Access MVP
Ellison Enterprises - Your One Stop IT Experts
 

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