Results 1 to 3 of 3
  1. #1
    5 Star Lounger
    Join Date
    Jan 2005
    Posts
    614
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Combo Value is ignored (Access2003)

    Please, help me to understand.

    I have a form with Check box and Combo box.

    All of my variables registered as globals.

    When check box is checked and combo box has nothing - following code should be executed and it working:

    If Forms![Excel Export]!Check1.Value = True And Forms![Excel Export]!Combo2.Value = False Then GoTo ALL

    When check box checked and combo box has value - code is still missing the line and goes to ALL as if it was the first code line:

    If Forms![Excel Export]!Check1.Value = True And Forms![Excel Export]!Combo2.Value = True Then
    execute following code
    End If

    My question is what is wrong with the second line and why does it ger overlooked?

    If I will place variable strComboValue = Forms![Excel Export]!Combo2.Value
    strComboValue will read the value from the Combo2 but will still ignore the line and go to ALL.

    Please, help.

    P.S. RowSource for the combo is a table/query - table name.

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Combo Value is ignored (Access2003)

    The value of a combo box usually isn't true or false, but either null or a text string. Try this:

    If Forms![Excel Export]!Check1.Value = True And Not IsNull(Forms![Excel Export]!Combo2) Then

  3. #3
    5 Star Lounger
    Join Date
    Jan 2005
    Posts
    614
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Combo Value is ignored (Access2003)

    Of course! I was just looking at the declaration and it is Variant (I am editing someone elses code) and I thought it is no way True/False but I did not know what is it actually IS. Thanks as always!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •