Results 1 to 7 of 7
  1. #1
    wolfm is offline Advanced Beginner
    Windows 7 32bit Access 2013
    Join Date
    Dec 2013
    Posts
    93

    Query is too complicated!

    I have a simple table to track our phone calls made to our truck drivers.
    The call logs are entered into a form, using a drop down list lookup to populate driver's name that was called in each record. The driver's names are listed in a separate table from the call logs.
    Now, when I create a query to narrow down the call logs made to a specific driver, I get an error message telling me that my criteria is too complex.


    So, it seems to me it can't find the driver's names. I know there is a way around this, but cannot remember how.

    I could have the users run the general query and then filter manually to the specific driver, but that seems cumbersome, and I don't want users changing the query in error.

    Any direction would be greatly appreciated! Thanks!

  2. #2
    pbaldy's Avatar
    pbaldy is online now Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    What's the SQL? It shouldn't be a problem to have 2 tables joined together and have a criteria. Are the data types of joined fields the same? Can you attach the db here?
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    CJ_London is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,397
    I get an error message telling me that my criteria is too complex.
    this usually happens when you have issues with your data - for example nulls that are not handled in your query

  4. #4
    wolfm is offline Advanced Beginner
    Windows 7 32bit Access 2013
    Join Date
    Dec 2013
    Posts
    93
    Driver Call List - Copy.zipSQL of the 'Phone Calls Query By Driver' is
    Code:
    SELECT [Phone Calls].CallDate, [Phone Calls].CallTime, [Phone Calls].Driver, [Phone Calls].Answer, [Phone Calls].NoAnswer, [Phone Calls].LeftVoicemail, [Phone Calls].TookCall, [Phone Calls].Comments
    FROM [Phone Calls]
    WHERE ((([Phone Calls].Driver)=[Enter Driver's Name]));
    I believe the joined data types are different; one is the primary key and one is short text.
    My DB is attached. Thanks!

  5. #5
    pbaldy's Avatar
    pbaldy is online now Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    Quote Originally Posted by wolfm View Post
    I believe the joined data types are different; one is the primary key and one is short text.
    That is your problem. I'd use a form to select driver and use the ID, but this approximates what you're doing now:

    SELECT [Phone Calls].CallDate, [Phone Calls].CallTime, Drivers.DriverName, [Phone Calls].Answer, [Phone Calls].NoAnswer, [Phone Calls].LeftVoicemail, [Phone Calls].TookCall, [Phone Calls].Comments
    FROM Drivers INNER JOIN [Phone Calls] ON Drivers.ID = [Phone Calls].Driver
    WHERE (((Drivers.DriverName)=[Enter Driver's Name]));
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  6. #6
    wolfm is offline Advanced Beginner
    Windows 7 32bit Access 2013
    Join Date
    Dec 2013
    Posts
    93
    It worked beautifully! Thank you so much! I appreciate the help!

  7. #7
    pbaldy's Avatar
    pbaldy is online now Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    Happy to help!
    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. Buidling a complicated query
    By Lou_Reed in forum Access
    Replies: 17
    Last Post: 03-21-2017, 09:49 PM
  2. Complicated Query
    By RozS in forum Access
    Replies: 5
    Last Post: 01-28-2014, 02:49 PM
  3. MOST COMPLICATED query ever
    By dastr in forum Queries
    Replies: 1
    Last Post: 07-05-2012, 04:29 AM
  4. Query with Complicated Requirements
    By Briana in forum Queries
    Replies: 1
    Last Post: 06-13-2012, 08:05 PM
  5. Complicated Query (Interleave rows?)
    By crozfader in forum Queries
    Replies: 8
    Last Post: 09-19-2011, 12:15 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