Dependent Combo Boxes - No Values

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

Guest

I have a series of combo boxes on a subform which are populated based on values chosen from either the main form or the previous combo boxes on the subform. Some of these boxes will have no values to select from. If there are no values in the combo box (based on the previous selections), I would like the combo box disabled so the user does not have to pull down the arrow and find there is nothing to select. I am thinking this would be done after the requery of each selection

How should I do this

Thank you.
 
Michelle

Be careful with the dependent combo box situation. Depending how you set it
up, you could run into unexpected results.

Data in a combo box control on a continuous form/datasheet disappears
http://www.fmsinc.com/free/tips.html#tip16foraccess


--
Rob

FMS Professional Solutions Group
http://www.fmsinc.com/consulting

Software Tools for .NET, SQL Server, Visual Basic & Access
http://www.fmsinc.com

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Michelle said:
I have a series of combo boxes on a subform which are populated based on
values chosen from either the main form or the previous combo boxes on the
subform. Some of these boxes will have no values to select from. If there
are no values in the combo box (based on the previous selections), I would
like the combo box disabled so the user does not have to pull down the arrow
and find there is nothing to select. I am thinking this would be done after
the requery of each selection.
 
Thank you, Rob, for your reply. I do not have a problem populating the como boxes. My issue has to do with allowing the user to know whether he/she should bother pulling down the combo box down arrow to see if there are values to select from. Depending on prior combo box pull downs, there may or may not be. Since the form has about 15 combo boxes, I thought it would be nice to disable the combo boxes that have no values for the user to choose from to save time and frustration

If you can help with this issue, that would be great

Thank you again, Michell

----- RobFMS wrote: ----

Michell

Be careful with the dependent combo box situation. Depending how you set i
up, you could run into unexpected results

Data in a combo box control on a continuous form/datasheet disappear
http://www.fmsinc.com/free/tips.html#tip16foracces


--
Ro

FMS Professional Solutions Grou
http://www.fmsinc.com/consultin

Software Tools for .NET, SQL Server, Visual Basic & Acces
http://www.fmsinc.co

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Michelle said:
I have a series of combo boxes on a subform which are populated based o
values chosen from either the main form or the previous combo boxes on th
subform. Some of these boxes will have no values to select from. If ther
are no values in the combo box (based on the previous selections), I woul
like the combo box disabled so the user does not have to pull down the arro
and find there is nothing to select. I am thinking this would be done afte
the requery of each selection
 
In the afterupdate of the combo box BEFORE the one you are checking, add the
following piece of code:

Me.Combo0.ItemData(0)

(where "Combo" is the name of your control)

This will look at the first value in the combo box. If its blank/null, then
you know that there is no records to be displayed.

Let me know how this works for you (either email directly or via the
newsgroups)

--
Rob

FMS Professional Solutions Group
http://www.fmsinc.com/consulting

Software Tools for .NET, SQL Server, Visual Basic & Access
http://www.fmsinc.com

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Michelle said:
Thank you, Rob, for your reply. I do not have a problem populating the
como boxes. My issue has to do with allowing the user to know whether
he/she should bother pulling down the combo box down arrow to see if there
are values to select from. Depending on prior combo box pull downs, there
may or may not be. Since the form has about 15 combo boxes, I thought it
would be nice to disable the combo boxes that have no values for the user to
choose from to save time and frustration.
 
Back
Top