Combo Box Auto Sort

M

Maurita

Hi, I am new to this Group and am working on a Free Clinic database on
a volunteer basis. The problem I am having is that I have created a
combo box with three fields, Name, Title, and Status (Active,
Terminated, Unavailable). I have searched through the Group's previous
posts to find out how to automatically search the third field and
automatically return only records matching certain criteria, but have
had no luck. I want the user to only see "Active" employees in this
combo box when the form is loaded, which is the third column. The
combo box is based on a table.

Thank you in advance for any help in the above issue.

Maurita Searcy
 
G

Guest

The row source property of a combo box is just like using a query. You can
filter out those entries that are not Active with a WHERE clause either in
the query you are using for the row source or using SQL in the row source
property. If you are using a table directly, you will need to change to a
query so you can do the filtering. It is not even necessary to include the
field in the row source if you are filtering on it.

SELECT [Name], [Title] FROM Volunteers WHERE [Status] = 'Active'

A note here. The field names Name and Title will have to be bracketed.
They are both reserved words and will confuse Access. One trick to avoid
naming conflicts is to use a consistent prefix naming scheme.
 
M

Maurita

Klatuu,

Thank you so very much for your help, your suggestion was just what I
needed. I now have the database complete and can now continue with the
second of three databases that I have to complete for the Free Clinic.


Again, thank you.

Maurita
The row source property of a combo box is just like using a query. You can
filter out those entries that are not Active with a WHERE clause either in
the query you are using for the row source or using SQL in the row source
property. If you are using a table directly, you will need to change to a
query so you can do the filtering. It is not even necessary to include the
field in the row source if you are filtering on it.

SELECT [Name], [Title] FROM Volunteers WHERE [Status] = 'Active'

A note here. The field names Name and Title will have to be bracketed.
They are both reserved words and will confuse Access. One trick to avoid
naming conflicts is to use a consistent prefix naming scheme.

Maurita said:
Hi, I am new to this Group and am working on a Free Clinic database on
a volunteer basis. The problem I am having is that I have created a
combo box with three fields, Name, Title, and Status (Active,
Terminated, Unavailable). I have searched through the Group's previous
posts to find out how to automatically search the third field and
automatically return only records matching certain criteria, but have
had no luck. I want the user to only see "Active" employees in this
combo box when the form is loaded, which is the third column. The
combo box is based on a table.

Thank you in advance for any help in the above issue.

Maurita Searcy
 

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