default a combo box based on a message box

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Jollywg
    New Member
    • Mar 2008
    • 158

    default a combo box based on a message box

    I have a combo box with 6 different options (opt1 ,opt2, opt3 etc). When the form first loads it asks a question and gives them a choice of answers (ans1, ans2) If they choose ans1 i want the drop down box to default to opt6, if they choose ans2 i want it to load normally. I thought i could just do this in the load section
    Code:
    if (ans1 = true) then
    cbo1 = opt6
    end if
    thanks for any help
  • ADezii
    Recognized Expert Expert
    • Apr 2006
    • 8834

    #2
    [CODE=vb]
    If (ans1 = True) Then
    Me![cbo1] = "opt6"
    Else
    Me![cbo1] = ""
    End If[/CODE]

    Comment

    • NeoPa
      Recognized Expert Moderator MVP
      • Oct 2006
      • 32645

      #3
      Well, you're pretty well there as far as I can see anyway (other than the quotes of course) :
      Code:
      If ans1 = True then Me.cbo1 = "opt6"
      You don't really want an ELSE clause.

      Comment

      • Jollywg
        New Member
        • Mar 2008
        • 158

        #4
        Thanks for the replies...once i saw how to do it a big DUH! sign got slapped across my forehead.

        Thanks a lot!

        Comment

        • NeoPa
          Recognized Expert Moderator MVP
          • Oct 2006
          • 32645

          #5
          Hey, we've all been there you know :D

          Comment

          Working...