Connecting Tech Pros Worldwide Help | Site Map

Help with the form

Newbie
 
Join Date: Apr 2007
Posts: 2
#1: Apr 3 '07
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.
iburyak's Avatar
Expert
 
Join Date: Nov 2006
Posts: 1,017
#2: Apr 3 '07

re: Help with the form


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.
Irina.
Newbie
 
Join Date: Apr 2007
Posts: 2
#3: Apr 4 '07

re: Help with the form


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
Else
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!
iburyak's Avatar
Expert
 
Join Date: Nov 2006
Posts: 1,017
#4: Apr 4 '07

re: Help with the form


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.
Reply


Similar Visual Basic 4 / 5 / 6 bytes