+ Reply to Thread
Results 1 to 5 of 5

Using INSTR to Match Value in ComboBox

  1. #1
    Forum Contributor
    Join Date
    12-10-2008
    Location
    Austin
    Posts
    660

    Using INSTR to Match Value in ComboBox

    Hi all,

    I've got an issue where the exact string is not being referenced when choosing from a selection of numbers in a list.

    Here's what I mean,

    Using the following bit of code,
    Please Login or Register  to view this content.
    Say for instance if ,Result = 150
    ComboBox22.List contains the numbers, 10,15,25,50, 100,150

    I need it to display, 150 in the combobox.

    However, for some reason which I can't figure out, it will list 50.

    I've also tried switching the order of the stings,
    Please Login or Register  to view this content.
    However this does not help.


    Any help with correcting this issue is appreciated.

    Thanks,

    BDB
    Last edited by bdb1974; 01-04-2011 at 04:11 PM.

  2. #2
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,167

    re: Using INSTR to Match Value in ComboBox

    Hi BDB
    InStr takes two strings for arguments. I wonder if the ABS function which returns numbers is the problem?
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  3. #3
    Forum Contributor
    Join Date
    12-10-2008
    Location
    Austin
    Posts
    660

    re: Using INSTR to Match Value in ComboBox

    No. I just stuck that in there to try to fix this issue.

  4. #4
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,167

    Re: Using INSTR to Match Value in ComboBox

    I guess we need a sample file. Can you upload one pointing to the formula that isn't working so we can see it? You need to "Go Advanced: below the message area and then click on the PaperClip Icon to upload a file.

  5. #5
    Forum Contributor
    Join Date
    12-10-2008
    Location
    Austin
    Posts
    660

    Re: Using INSTR to Match Value in ComboBox

    My only guess, that's its doing what it's doing, is because it's comparing two strings and
    the order that the two strings are listed inside the INSTR aurgument is irrelevant.
    So I guess whatever gets matched first , the 50 within the comobox list or the value
    to match in this case( Result=150), it so happens to be the 50 within the (Result=150)
    and not the (Result=150) to the 150 within the combobox list.

    To get around this, I stuck in another conditional argument.

    Please Login or Register  to view this content.
    This assures theres an exact match.

    Thanks for your thoughts.

    BDB
    Last edited by bdb1974; 01-04-2011 at 04:13 PM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1