setting rowsource on combo box

  • Thread starter Thread starter karen scheu via AccessMonster.com
  • Start date Start date
K

karen scheu via AccessMonster.com

I have a form with three combo boxes. Each of them requires "ALL" to
appear in the list and so I have as the recordsource a SQL statemenmt
including a Union as follows:
SELECT "ALL" As user_stat_desc, 00 AS user_stat_code FROM t_status
UNION
SELECT user_stat_desc, user_stat_code FROM t_status
ORDER BY user_stat_desc, user_stat_code

But... Now I need to add criteria to this based on a selection from another
combo box on the form. For example, I only want to see the statuses appear
in the second combo box that exist for the division selection in the first
combo box. Do I need to create the SQL for the second combo box's
recordsource in code on the After Update event of the first combo box? Can
someone give me an example since I am new to writing code within the access
environment.

Thanks,
Karen
 
an example could be by using a subsutution statement.

dd.RowSource="SELECT User_Stat_Desc, User_Stat_Code
FROM (SELECT "ALL" As user_stat_desc, 00 AS user_stat_code FROM t_status
UNION
SELECT user_stat_desc, user_stat_code FROM t_status
ORDER BY user_stat_desc, user_stat_code) t_status
WHERE User_stat_code='" & Criterium & "'"


- Raoul
 
Back
Top