Programming

A

Ashley

I have 87 combo boxes. Their value is either Yes or No.
I am wondering is there a shortest method to make the last
combobox (87th) to be "Yes" if the first 86 comboboxes are
Yes otherwise it is "No".
Right now, all I can think of is to list all 86 combobox
names equal to "Yes" else equal to "No". Is this the only
way to do it?

Ashley
 
G

Graeme Richardson

Hi Ashley, I'm unsure of the reason you would want to do this, however you
might be able to try this method

1) Name your ComboBoxes cbo01, cbo02, ..., cbo87

2) run the code after updating any of the first 86 ComboBoxes

Dim intCount As Integer
Dim blnTest as Boolean: blnTest = True
For intCount = 1 To 86
blnTest = blnTest And (Me("cbo" & Format(intCount,"00")).Value = "Yes")
Next
If blnTest Then
cbo87 = "Yes"
End If

Hope this helps, Graeme
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top