By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,097 Members | 1,252 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,097 IT Pros & Developers. It's quick & easy.

Help with the form

P: 2
Hello and please help anybody!!!
I have a survey form in access database that has combo boxes to choose answers from Yes, and No. I have one combo box - Combo Box1 that has to become disabled if the other 3 combo boxes Cmbo box2, 3,4 has answers "No"
i can't come uo with the right logical code for this. Help Please!!!
thank you in advance.
Apr 3 '07 #1
Share this Question
Share on Google+
3 Replies

Expert 100+
P: 1,017
You have interesting nick.

In change event of ALL 3 comboboxes

Put following code:

[PHP]If ucase(combobox2.text) = 'NO' and ucase(combobox3.text) = 'NO' and ucase(combobox4.text) = 'NO' then
combobox1.text = ''
combobox1.enabled = false
end if[/PHP]

Hope it helps.
Good Luck.
Apr 3 '07 #2

P: 2
thank you very much!!! now i have another thing that is not working.
Is there something wrong with this statement, the part where Me.CN10.Enabled = True and Me.CN10.Enabled = False not working . lstSpecialist is the list box with dates of visit, I need to do the following : if there no dates in the list boxlstSpecialist then me.cn10(combo box) has to be gray out.
here is the code i have so far, but the part that has to disable combo box not working, i don't get any erroe message it just simply do not disabling combo box.
if Not IsNull(Me.lstSpecialist.RowSource) Then
sSQL = "SELECT dbo_tblNewVisitTracking.DOS FROM dbo_tblNewVisitTracking"
sSQL = sSQL & " Where dbo_tblNewVisitTracking.Sub_ID= '" & strSub_ID & "'"
sSQL = sSQL & " and dbo_tblNewVisitTracking.Visit_Type = 'Specialist'"
Me.lstSpecialist.RowSource = sSQL
Me.CN10.Enabled = True
Me.lstSpecialist.Enabled = False
Me.lstSpecialist.Locked = True
Me.CN10.Enabled = False
Me.CN10 = "N/A"
Me.CN10.Locked = True
End If

thank you very much!
Apr 4 '07 #3

Expert 100+
P: 1,017
I am not an Access expert but it looks like

instead of this :
[PHP]if Not IsNull(Me.lstSpecialist.RowSource) Then[/PHP]

you could check this:

[PHP]if Me.lstSpecialist.text = "" Then[/PHP]

Hope it helps.
Apr 4 '07 #4

Post your reply

Sign in to post your reply or Sign up for a free account.