Results 1 to 5 of 5
  1. #1
    premis is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Posts
    33

    Query doesn't display any results

    I am trying to build a query for a client database that I can search a field for their client status (current client, in progress, etc) I built the query, but when I run it I don't get any records returned. I am using a form to enter the query criteria and then using the query to populate another form. I have done this with names, e-mails, etc and they work fine. I'm not sure why I am having trouble with this. Here is my query SQL

    SELECT Clients.Status, Clients.Company, Clients.[Last Name], Clients.[First Name], Clients.[E-mail Address], Clients.[Business Phone], Clients.[Home Phone], Clients.[Mobile Phone], Clients.Notes
    FROM Clients
    WHERE (((Clients.Status) Like "*" & [Forms]![Client Search Form]![Status] & "*"));
    In this case the form "client search form" has a box "status" that I am entering the criteria (ex: "In Progress"). I then have a macro button on that form with the following:



    OpenQuery - SearchQueryStatus, Datasheet, Edit
    OpenForm - SearchQueryClientStatus, Form, , , , Normal
    Close - Query, SearchQueryStatus, Prompt
    This is built the same way as my other queries, so I'm not sure why it isn't working. Any help would be appreciated.

  2. #2
    alansidman's Avatar
    alansidman is offline Indifferent
    Windows 7 32bit Access 2010 32bit
    Join Date
    Apr 2010
    Location
    Steamboat Springs
    Posts
    2,536
    Is the status on your form a combo box that is linked to another table with the status' listed? If so, have you added this table to your query?

    Alan

  3. #3
    premis is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Posts
    33
    Thanks for the reply, Alan.

    The status on my form is now linked to the table with my status' (it wasn't before). But it is only pulling the ID column, not the 2nd column that lists the status'. Do you know how I can pull the correct column? As for adding the table to my query. The query only uses my clients table (with all the client information). It uses the status field in the client table to search for status using this formula
    Like "*" & [Forms]![Client Search Form]![Status] & "*"
    . The status field on the clients table sources the client status table.

    I hope I'm explaining it correctly, I'm a bit of a newb for access.

  4. #4
    alansidman's Avatar
    alansidman is offline Indifferent
    Windows 7 32bit Access 2010 32bit
    Join Date
    Apr 2010
    Location
    Steamboat Springs
    Posts
    2,536
    You need to add the second column showing the status to the QBE grid. For the ID, make sure that the display box on the QBE is unchecked so that you only see the status displayed.

  5. #5
    premis is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Posts
    33
    I got it!! Thank you so much Alan! I greatly appreciate the help!

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

Similar Threads

  1. Display QUERY results into SUB FORM
    By taimysho0 in forum Programming
    Replies: 9
    Last Post: 11-23-2011, 12:26 PM
  2. Display RESULTS of Query into LISTBOX?
    By taimysho0 in forum Programming
    Replies: 6
    Last Post: 11-22-2011, 10:05 PM
  3. Replies: 1
    Last Post: 12-01-2010, 11:10 AM
  4. Display Query Results on a Form
    By P5C768 in forum Queries
    Replies: 5
    Last Post: 05-04-2010, 11:04 AM
  5. display query results in a form
    By P5C768 in forum Queries
    Replies: 3
    Last Post: 08-14-2009, 03:02 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