Results 1 to 4 of 4
  1. #1
    JimO is offline Competent Performer
    Windows 10 Access 2010 64bit
    Join Date
    Dec 2015
    Posts
    126

    Where clause in a list box issue

    Using the code,

    Code:
    ANListBox.RowSource = "SELECT AMID, Game, Year, Location, City, State, Result, GmScore FROM SportsArmyNavyQry ORDER BY Year;"
    my button works as planned. If I add a where clause the data fails to show.



    Code:
    ANListBox.RowSource = "SELECT AMID, Game, Year, Location, City, State, Result, GmScore FROM SportsArmyNavyQry WHERE Game = "Army" ORDER BY Year;"
    I am at a loss to track down the issue, why the first works and the second does not. If I just use the second "select statement as the source code it works fine.

    Jim O

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Try changing the internal quotes to single quotes.
    ANListBox.RowSource = "SELECT AMID, Game, Year, Location, City, State, Result, GmScore FROM SportsArmyNavyQry WHERE Game = 'Army' ORDER BY Year;"

  3. #3
    JimO is offline Competent Performer
    Windows 10 Access 2010 64bit
    Join Date
    Dec 2015
    Posts
    126
    Thank you so much. That does it job.

    Thanks,
    Jim O

  4. #4
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    You're very welcome. Glad we could help.

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

Similar Threads

  1. Phone List issue
    By Alfi54 in forum Forms
    Replies: 8
    Last Post: 04-17-2012, 09:47 AM
  2. Order By Clause Issue
    By josh in forum Queries
    Replies: 5
    Last Post: 02-22-2012, 04:35 PM
  3. List box drop Issue
    By JonM in forum Access
    Replies: 1
    Last Post: 09-30-2011, 12:56 PM
  4. list box goto record issue
    By Madmax in forum Access
    Replies: 2
    Last Post: 07-07-2011, 06:17 AM
  5. List Box Issue
    By Igawa29 in forum Programming
    Replies: 4
    Last Post: 02-22-2011, 01:19 PM

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