Results 1 to 3 of 3
  1. #1
    Shamli is offline Competent Performer
    Windows 7 64bit Access 2013 64bit
    Join Date
    Jul 2018
    Location
    California
    Posts
    142

    List bpx not displaying any data

    Hello Everyone.
    I am trying to display data based on the list box selection.
    this is the query:
    SELECT Projects_T.ProjectID, Projects_T.ProjectName, Element_T.Element, EmpToProj.EmployeeID, EmpToProj.StartDate, EmpToProj.Enddate " _
    & "FROM (Element_T INNER JOIN Projects_T ON Element_T.ElementID = Projects_T.ElementID) INNER JOIN EmpToProj ON Projects_T.ProjectID = EmpToProj.ProjectID " _
    & "WHERE (SELECT EmployeeID FROM EmpToProj " _
    '& "WHERE EmployeeID = " & lstEmployee.Column(1) _
    & "ORDER BY Element;"


    What am I doing wrong here?

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,550
    Do not use listbox columns in a query.
    set the Bound column in the listbox,
    then query on the list. No column needed.
    then it will work.

  3. #3
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,772
    This is VBA constructing SQL statement? Why the nested query? EmployeeID is actually in second column? Need space in front of ORDER so compiled string doesn't run together.

    & "WHERE EmployeeID = " & Me.lstEmployee.Column(1) & " ORDER BY Element;"
    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.

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

Similar Threads

  1. Replies: 6
    Last Post: 07-12-2018, 11:14 PM
  2. Displaying List Entries From A Combo Box
    By Henry Hill in forum Forms
    Replies: 1
    Last Post: 06-06-2016, 03:07 PM
  3. Replies: 9
    Last Post: 11-24-2014, 02:20 PM
  4. Replies: 5
    Last Post: 08-11-2014, 03:08 PM
  5. Replies: 3
    Last Post: 03-25-2010, 12:31 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