enable controls based on query results

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a form that queries by YEAR and a CODE. The YEAR is selected by ComboBox
and the CODE by a Check Box. I have 4 check boxes. Each with one of the
following values:

CS
CS/P
MO
OL

Once the YEAR is selected, I would like to disable any of the check boxes
that will not be in the results for that YEAR.

I used a subform with a query with "GROUP BY" that queries the YEAR for all
possible values entered. Say 2005. It returns CS and CS/P. I would then like
to disable MO and OL check boxes. In other words, I will not find an entry of
MO or OL for any record in 2005 therefore only needthe option to check that
are CS OR CS/P.

How can I get this to work or is there a better way to this.

Thanks.
 
I have never tried it with a check box but you can use a Combo Box and have
code for the Got Focus event like:

Me.Code.RowSource = "SELECT Code FROM TableName WHERE Year = '" &
Me.YearField & "'"
 
Back
Top