Results 1 to 3 of 3
  1. #1
    markjkubicki's Avatar
    markjkubicki is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Jul 2010
    Location
    Fire Island Pines, NY
    Posts
    496

    INSTR(), quick little syntax ?

    I have as a rowsource for a combo box a table which includes several records that I do not want as choices in the drop-down list. All of those records contain the word "Integral" in the field [options], so I thought adding a criteria:



    INSTR(1,[options], "Integral")<>0

    would do the trick, but every at itteration I can think of, it does not.

    additionaly,
    for those remaining records, some of them contain the word "Remote" which I would like to strip from the record text (it is always the 1st six letters; so, as a second criteria, I wrote something like this:

    IIF(INSTR(1,[options], "Remote")<>0, MID([options],8), [options])


    maybe I just don't have my thinking cap on today,
    ...much thanks in advance,
    Mark

  2. #2
    weekend00 is offline I may not be right
    Windows XP Access 2003
    Join Date
    Aug 2010
    Posts
    1,295
    use a query as row source of the combo box:
    select xxx,xxxx from atable where options not like "*Integral*"

  3. #3
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    I don't think I'd use InStr() for either. For the first, this should work:

    SELECT...
    FROM...
    WHERE Options Not Like "*Integral*"

    For the second, I'd probably use Replace():

    Replace([Options], "Remote", "")
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Quick help w/ Mailto??
    By Visfire in forum Programming
    Replies: 3
    Last Post: 09-17-2010, 08:36 AM
  2. Incomplete Syntax Clause (syntax error)
    By ajetrumpet in forum Programming
    Replies: 4
    Last Post: 09-11-2010, 10:47 AM
  3. Quick Question
    By Imgsolutions in forum Access
    Replies: 3
    Last Post: 07-19-2010, 11:22 AM
  4. Quick Help with Printing
    By Imgsolutions in forum Access
    Replies: 1
    Last Post: 07-06-2010, 02:02 PM
  5. quick query syntax questions
    By cowboy in forum Access
    Replies: 6
    Last Post: 02-03-2010, 06:10 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums