Using lookup in a table trying to use rowsource

B

BethV

I have a table that has several lookup drop-down columns. What I would like
to do in one of the drop down menus is say if the Project_Type =
"Assessments', then choose this List_Assessments to use as the drop down, if
Project_Type = "Calls", then choose Data_Calls to use as the drop down. Does
anyone know if this can be done.

Thanks.
 
A

Avlan

Yes it can be done. You can change the rowsource of a control with
code, smt like:

Controlname.RowSource = "SELECT columname FROM tablename WHERE x =
whatever"

Put that into your button-code.

Btw I recommend you ALWAYS use code to set the rowsource and NEVER use
the properties-box of a control to do this. Bound controls are risky,
and if not risky, it's rather confusing to have all kinds of control
with all kinds of code embedded. I just make unbound controls or
txtfields and put the "Rowsource =" in the on_load_form-part of the
form's module.
 
Top