Help with the form

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • irinaayz
    New Member
    • Apr 2007
    • 2

    #1

    Help with the form

    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
    Recognized Expert Top Contributor
    • Nov 2006
    • 1016

    #2
    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.enabl ed = false
    end if[/PHP]

    Hope it helps.
    Good Luck.
    Irina.

    Comment

    • irinaayz
      New Member
      • Apr 2007
      • 2

      #3
      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 boxlstSpecialis t 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.lstSp ecialist.RowSou rce) Then
      sSQL = "SELECT dbo_tblNewVisit Tracking.DOS FROM dbo_tblNewVisit Tracking"
      sSQL = sSQL & " Where dbo_tblNewVisit Tracking.Sub_ID = '" & strSub_ID & "'"
      sSQL = sSQL & " and dbo_tblNewVisit Tracking.Visit_ Type = 'Specialist'"
      Me.lstSpecialis t.RowSource = sSQL
      Me.CN10.Enabled = True
      Else
      Me.lstSpecialis t.Enabled = False
      Me.lstSpecialis t.Locked = True
      Me.CN10.Enabled = False
      Me.CN10 = "N/A"
      Me.CN10.Locked = True
      End If

      thank you very much!

      Comment

      • iburyak
        Recognized Expert Top Contributor
        • Nov 2006
        • 1016

        #4
        I am not an Access expert but it looks like

        instead of this :
        [PHP]if Not IsNull(Me.lstSp ecialist.RowSou rce) Then[/PHP]

        you could check this:

        [PHP]if Me.lstSpecialis t.text = "" Then[/PHP]

        Hope it helps.

        Comment

        Working...