Results 1 to 7 of 7
  1. #1
    Join Date
    Jan 2007
    Posts
    47

    Unanswered: Issue with list box

    Hi,

    Below is the code for after update event of a list box.

    Private Sub multiple_AfterUpdate()
    If multiple = "Declining values exist and are not explained" Then
    Form("pt" & 20).value = "10"
    End If
    End Sub


    The above code doesn't work. When I try to step into the code the value for "multiple" is showing null, even though I select the value. Can anyone please help me with this.

    I have also attached the screenshot of the form.

    Thanks in advance.
    Attached Files Attached Files

  2. #2
    Join Date
    May 2004
    Location
    New York State
    Posts
    1,178
    When you step into the code, stop before the If... statement and copy (select and <Ctrl><C>) the statement
    Code:
    multiple = "Declining values exist and are not explained"
    Open the Immediate window using <Ctrl><G> and paste the statement in there. Make sure your cursor is on the line with the text you just pasted, and hit Return. You have now initialized the variable multiple so the If statement will catch it. You can then close the Immediate window by Xing out of it, and continue stepping through the code.

    HTH,
    Sam

  3. #3
    Join Date
    Jan 2007
    Posts
    47
    No luck. The value for "Multiple" still shows null. Should I change from After update event to On click event?

    Thanks.

  4. #4
    Join Date
    May 2005
    Location
    Nevada, USA
    Posts
    2,888
    Provided Answers: 6
    If the listbox is multiselect, you'll need code to find the selected value(s). Searching here for multiselect should turn it up.
    Paul

  5. #5
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    Have we tried
    Multiple.Column(0) = ... ?
    (may be column(1)..)
    George
    Home | Blog

  6. #6
    Join Date
    May 2004
    Location
    New York State
    Posts
    1,178
    Forgive me, but I'm a bit confused. Please allow me a few questions.

    1) Are the choices in the list box typed in, or are they coming from a Table/Query?

    2) What are some of the choices?

    Also, Paul's comment got me to thinking... Did you select the value in the list box to fire the event, or are you trying to run it manually?

    Sam

  7. #7
    Join Date
    Jan 2007
    Posts
    47
    I tried with Multiple.Column(0) = ... ? and it worked.

    Thank you so much.

Posting Permissions

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