Results 1 to 13 of 13
  1. #1
    Join Date
    May 2020
    Posts
    7

    Angry Query in Access Comes up Blank


    Hi Guys,

    I'm new to Access, but not so much on HTML/Java/Lingo/CSS, etc. But, I started a new job and they have a simple Access program, the function that doesn't work is the 'Lookup all jobs from this customer' It's a drop-down and click the 'view all customer' button, well... it comes up blank. I was wondering if the extra &..& have anything to do with it?! I've tried to tweak it a few times, no luck. All the other functions work; the database is acceptable other places. Below is the query - please help! - Thx, Russo

    SELECT CustomerNo, ([FirstName]+" ") & [BusOrLastName] AS CustomerName, [tblContacts].[ConFirstName] & " " & [ConLastName] AS ContactName, tblJobs.CustomerPONo, tblJobs.JobDescription, tblJobs.OrderDate, tblJobs.DueDate, tblJobs.DoneDate, tblJobs.OfficeCopyNotes, tblJobs.ShopCopyNotes, tblCustomers.CustRowID
    FROM (tblCustomers INNER JOIN tblJobs ON tblCustomers.CustRowID = tblJobs.CustRowID) INNER JOIN tblContacts ON (tblCustomers.CustRowID = tblContacts.CustRowID) AND (tblJobs.ContactIDRowNo = tblContacts.ContactIDRowNo) AND (tblJobs.ContactIDRowNo = tblContacts.ContactIDRowNo) AND (tblCustomers.CustRowID = tblContacts.CustRowID)
    WHERE (((tblCustomers.CustRowID)=[Forms]![frmLookUpJobsByCustomer]![fldCustCode]))
    ORDER BY CustomerNo;

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,772
    No, the field concatenation should not be an issue.

    Exactly what is fldCustCode - textbox or combobox name? If it is a combobox, what is the RowSource?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,550
    in immediate window, (ctrl-G), see if the combo gives the cortect value:
    ?[Forms]![frmLookUpJobsByCustomer]![fldCustCode]

  4. #4
    Join Date
    May 2020
    Posts
    7
    Quote Originally Posted by June7 View Post
    No, the field concatenation should not be an issue.

    Exactly what is fldCustCode - textbox or combobox name? If it is a combobox, what is the RowSource?
    ----------------------

    The fldCustCode is a list; The combobox is actually labled 'CustRowID_Label'

    Row Source = SELECT tblCustomers.CustRowID, tblCustomers.CustomerNo, ([FirstName]+" ") & [BusOrLastName] AS Name, tblCustomers.AcctStatus FROM tblCustomers WHERE (((tblCustomers.AcctStatus)<>'delinquent' And (tblCustomers.AcctStatus)<>'inactive')) ORDER BY tblCustomers.CustomerNo;


    Thanks,
    Russ

  5. #5
    Join Date
    May 2020
    Posts
    7
    I couldn't seem to find the immediate window, like the older versions of Access. The value in the SQL view the set Criteria on the CustRowID is: [Forms]![frmLookUpJobsByCustomer]![fldCustCode]

    Thanks,
    Russ

  6. #6
    Join Date
    May 2020
    Posts
    7
    Some pics of what I'm looking at -

    Click image for larger version. 

Name:	CropSql.jpg 
Views:	14 
Size:	116.0 KB 
ID:	41823 Click image for larger version. 

Name:	CropSql2.jpg 
Views:	14 
Size:	172.8 KB 
ID:	41824

  7. #7
    orange's Avatar
    orange is offline Moderator
    Windows 10 Access 2016
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,870
    Ctrl-G should get you the immediate window.

  8. #8
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,772
    So fldCustCode is name of combobox or is it CustRowID?

    Is combobox bound? If you use a bound control to input filter criteria you will change data in record.

    If you want to provide db for analysis, follow instructions at bottom of my post.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  9. #9
    Join Date
    May 2020
    Posts
    7
    CustRowID is the name of the combobox (drop-down)

    It's unbound

    Attached is the db and access file - the area that is broke is:

    Jobs - Look up Jobs by Customer

    https://qwf.sharepoint.com/:u:/s/Sol...pVOiw?e=04VNCt

  10. #10
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,772
    No, name of combobox is fldCustCode.

    Might need to fix links in query. That circular linking could be confusing SQL engine.

    I don't use dynamic parameterized query nor macros. I prefer VBA to build filter criteria. Review http://allenbrowne.com/ser-62.html
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  11. #11
    Join Date
    May 2020
    Posts
    7
    I think it already is...

  12. #12
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,772
    Edited my post after downloading your db. You said CustRowID is name of combobox. It is not.

    Records don't show because of query links. I changed to:

    SELECT tblJobs.JobNo, ([FirstName]+" ") & [BusOrLastName] AS CustomerName, [tblContacts].[ConFirstName] & " " & [ConLastName] AS ContactName, tblJobs.CustomerPONo, tblJobs.JobDescription, tblJobs.OrderDate, tblJobs.DueDate, tblJobs.DoneDate, tblJobs.OfficeCopyNotes, tblJobs.ShopCopyNotes, tblCustomers.CustRowID
    FROM tblContacts RIGHT JOIN (tblCustomers INNER JOIN tblJobs ON tblCustomers.CustRowID = tblJobs.CustRowID) ON tblContacts.CustRowID = tblJobs.ContactIDRowNo
    WHERE (((tblCustomers.CustRowID)=[Forms]![frmLookUpJobsByCustomer]![fldCustCode]));
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  13. #13
    Join Date
    May 2020
    Posts
    7
    Thank you so much June7! You're awesome!

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

Similar Threads

  1. Replies: 2
    Last Post: 05-11-2020, 06:59 AM
  2. Replies: 2
    Last Post: 01-08-2020, 05:37 PM
  3. Replies: 1
    Last Post: 11-06-2019, 05:30 PM
  4. Replies: 2
    Last Post: 06-27-2014, 11:19 AM
  5. Replies: 1
    Last Post: 09-05-2008, 12:07 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