How to choose records based on two fields

G

Guest

I have a form based on a query, drawing from two tables.

One of the fields in the query, called [Season], can be either “Fall†or
“Springâ€

Another field is [District] and can be a number of names. There can be no
more than one spring field and/or one fall field for each district.

I want to select particular records based on the combination of those two
fields.

Rather than explain what I’ve tried that isn’t working, I’ll just ask for
help on what will work.

In a nutshell, I want to first pick the season (Fall or Spring) and then
choose the District from a combo box showing only those Districts having a
Fall or Spring field (depending which one I picked).

From that, it will show the record for that district/season combination in
the detail section.

Hope that’s not too confusing.

Jerry
 
G

Guest

For the linitation of the list of one combo depending on the selectio of
another try this link

http://www.mvps.org/access/forms/frm0028.htm
========================================
To look for a value using a filter on two fields, use DLookUp

=Dlookup("FieldName","TableName","[Season] = '" & Me.Season & "' And
[District] = '" & Me.District & "'")
========================================
If the District or Season fields type is number, you need to lose the single
quote
=Dlookup("FieldName","TableName","[Season] = " & Me.Season & " And
[District] = " & Me.District)
 

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