Results 1 to 4 of 4
  1. #1
    jonesy29847 is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Mar 2010
    Location
    Detroit area
    Posts
    43

    more than one table error in report mode

    I am receiving the following error message when I run a report;

    The specified field CustName could refer to more than one table in the FROM clause of your SQL statement.

    My SQL statement, which returns the desired results, is as fiollows;

    Code:
    SELECT PrimaryCustomer.ContactFirstName, PrimaryCustomer.ContactLastName, PrimaryCustomer.Phone, PrimaryCustomer.Fax, PrimaryCustomer.VendorID, [Project Expenses].[Expense Date], [Project Expenses].[Expense Description], [Project Expenses].[Expense Code], [Project Expenses].[Expense Amount], SecondaryCustomer.CustJobNumber, Invoice.JobName, PrimaryCustomer.CustName, PrimaryCustomer.StreetAddress, PrimaryCustomer.StateProvince, PrimaryCustomer.City, PrimaryCustomer.ZipPostalCode, PrimaryCustomer.PONumber, PrimaryCustomer.CustJobNumber, SecondaryCustomer.CustName, SecondaryCustomer.CustJobNumber, PrimaryCustomer.Terms
    FROM (Invoice INNER JOIN ([Project Expenses] INNER JOIN SecondaryCustomer ON [Project Expenses].JobNo = SecondaryCustomer.JobNo) ON Invoice.JobNo = [Project Expenses].JobNo) INNER JOIN PrimaryCustomer ON Invoice.JobNo = PrimaryCustomer.JobNo
    GROUP BY PrimaryCustomer.ContactFirstName, PrimaryCustomer.ContactLastName, PrimaryCustomer.Phone, PrimaryCustomer.Fax, PrimaryCustomer.VendorID, [Project Expenses].[Expense Date], [Project Expenses].[Expense Description], [Project Expenses].[Expense Code], [Project Expenses].[Expense Amount], SecondaryCustomer.CustJobNumber, Invoice.JobName, PrimaryCustomer.CustName, PrimaryCustomer.StreetAddress, PrimaryCustomer.StateProvince, PrimaryCustomer.City, PrimaryCustomer.ZipPostalCode, PrimaryCustomer.PONumber, PrimaryCustomer.CustJobNumber, SecondaryCustomer.CustName, SecondaryCustomer.CustJobNumber, PrimaryCustomer.Terms, [Project Expenses].JobNo
    HAVING ((([Project Expenses].[Expense Date]) Between [Forms]![Print Reports].[fmStartDate] And [Forms]![Print Reports].[fmEndDate]) AND (([Project Expenses].JobNo)=[Forms]![Print Reports].[JobNoCombo]))
    ORDER BY [Project Expenses].[Expense Date];
    The report explicitly uses PrimaryCustomer.CustName and SecondaryCustomer.CustName.

    What am I missing?

    Thanks

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,641
    If the query returns proper results, it's in the report somewhere. If the field is referenced properly in textboxes, you might look in Sorting and Grouping.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    jonesy29847 is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Mar 2010
    Location
    Detroit area
    Posts
    43

    Thumbs up Solved

    Solved, found it in Text Box, Thanks much!

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,641
    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. Replies: 0
    Last Post: 06-14-2010, 09:41 AM
  2. Problems with libraries in runtime mode
    By Fouti in forum Programming
    Replies: 1
    Last Post: 01-18-2010, 10:02 AM
  3. Open Form in Add Mode
    By Boreal2009 in forum Programming
    Replies: 2
    Last Post: 10-23-2009, 10:53 AM
  4. Need help w/ Forms/runtime mode
    By TechRetard in forum Access
    Replies: 1
    Last Post: 10-06-2009, 04:40 AM
  5. Median and Mode for a large table
    By brandon in forum Access
    Replies: 0
    Last Post: 05-08-2008, 09:26 AM

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