Link to home
Start Free TrialLog in
Avatar of Dozingquinn
DozingquinnFlag for Australia

asked on

Combo Box dependent on another combo box in a subform

Hello,

I have a main form [frm_leads] that has a combobox [cboVoidlead]. This combo box has two values 'yes' and 'no'.

I have a subform [sFrm_leaddetails] that has a combobox [cboLeadoutcome]. Among other values, this combo box has (among other values) the value 'Void'.

I would like to make the value of [cboVoidlead] display 'yes', if the value selected in [cboLeadoutcome] is 'Void'.

Could you please show me how to do this?
Avatar of frankytee
frankytee
Flag of Australia image

assuming your subform CONTAINER on your parent form is also called sFrm_leaddetails. Me is the access reserved keyword for the current form, use as is.

if me.sFrm_leaddetails.form.cboLeadoutcome = "yes" then
me.cboVoidlead = "YES"
else
me.cboVoidlead = "NO"
end if
SOLUTION
Avatar of Scott McDaniel (EE MVE )
Scott McDaniel (EE MVE )
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
i didnt read the question properly. go with lsm
Avatar of Dozingquinn

ASKER

Thanks LSM,

Yes your assumptions were correct. This is in a form. Your solution worked - just need to tinker it slightly.

Is there a way to alter the code so that if the user changes their selection from "void" (in cboLeadoutcome) , the value in cboVoidlead would change back to "No"?
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial