MS Access Combobox link

Can I have code that only allows a combobox to be used if another combobox has a value?
JSSeniorAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
peter57rConnect With a Mentor Commented:
Yes.

In the 'another combobox' use the afterupdate event procedure to enable or disable the dependent combo.

If isnull(me.anothercomboboxname) then
me.dependentcombo.enabled = false
else
me.dependentcombo.enabled = true
end if

0
 
JSSeniorAuthor Commented:
I take it the 2nd combobox will need enabled property set to false?

I currently have code in the form current property which locks the dependant combo if the other is blank but it seems to be locked eitger way.
0
 
peter57rCommented:
Yes,  the initial setting  in design  view should be false.

If the same form is used to browse records you need exactly the same code in the form_current event procedure.
0
 
JSSeniorAuthor Commented:
There is sql driving the dropdown values so wondering whether this maybe effecting it. SQl in dependant combo using value in other.
0
All Courses

From novice to tech pro — start learning today.