Filtering a Drop Down List/CBO

  • Thread starter Thread starter Melissa
  • Start date Start date
M

Melissa

I have a main Recruit form with a subform for
evaluations. Each eval record contains a date and a site.
The site is a drop down box whose source is a query built
on a tournament site table.

The results are that each recruit is "linked" to certain
tournaments.

My question:

As new evaluations are entered, I only want to the drop
down box of tournament sites to list list current sites
(i.e. tournaments being held this year). However, I need
the previous evaluations sites for a recruit to remain
visible in the previous evaluations.

Any suggestions?

Thanks in advance!

Melissa
 
Hi Melissa

Make two queries - one to list all the sites and another filtered to show
just the sites for the current year. Now you can make the decision in the
Form_Current event about which query to use. For example:

If Me.NewRecord or Year(Nz(EvalDate)) = Year(Date) then
cboSite.RowSource = "qryListCurrentSites"
Else
cboSite.RowSource = "qryListAllSites"
End If
 
Graham:

Worked like a charm. THANKS!

Melissa
-----Original Message-----
Hi Melissa

Make two queries - one to list all the sites and another filtered to show
just the sites for the current year. Now you can make the decision in the
Form_Current event about which query to use. For example:

If Me.NewRecord or Year(Nz(EvalDate)) = Year(Date) then
cboSite.RowSource = "qryListCurrentSites"
Else
cboSite.RowSource = "qryListAllSites"
End If

--
Good Luck!

Graham Mandeno [Access MVP]
Auckland, New Zealand

I have a main Recruit form with a subform for
evaluations. Each eval record contains a date and a site.
The site is a drop down box whose source is a query built
on a tournament site table.

The results are that each recruit is "linked" to certain
tournaments.

My question:

As new evaluations are entered, I only want to the drop
down box of tournament sites to list list current sites
(i.e. tournaments being held this year). However, I need
the previous evaluations sites for a recruit to remain
visible in the previous evaluations.

Any suggestions?

Thanks in advance!

Melissa


.
 
Back
Top