If else statement

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • elainenguyen
    New Member
    • Oct 2006
    • 51

    #1

    If else statement

    I am trying to write a code in the cmdSave to give a break message when user didn't answer a question. For example. I have a option field fraAge>60 with Y and N, when user chooses N as an aswer, user has to choose 3 other Y/N checkbox fields which belong to No answer i.e Age70, Age80, Age90. If user didn't check any of those 3 fields, then I have to give a break message and won't allow user to move on unless they check either Age70, Age80 or Age90.

    Code:
    If fraAge>60=No and .....
    I am not sure how to write these double condition.

    thanks!
  • lee123
    Contributor
    • Feb 2007
    • 556

    #2
    are these option buttons then you could put a msgbox to make sure they choose one of your other options

    Code:
    If  fraAge>60 = No then
         msgbox "Please choose one of the following options",,"Response"
                option1.setfocus
    end if
    lee123

    Comment

    • lee123
      Contributor
      • Feb 2007
      • 556

      #3
      where it say op1.setfocus you have to use this:

      If fraAge>60 = No then
      msgbox "Please choose one of the following options",,"Resp onse"
      option2.value = true
      end if

      sorry about that.

      lee123

      Comment

      • vdraceil
        New Member
        • Jul 2007
        • 236

        #4
        'if option1.value=f alse and check1.value=0 and check2.value=0 and check3.value=0 then ...'
        this 'if' structure will take care of multiple condition checking.

        Comment

        Working...