Results 1 to 4 of 4
  1. #1
    lbcarvalho is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Jul 2018
    Posts
    31

    Question Can't find what's wrong with my list box used in my table

    Hi! I have two tables: Clients and Jobs. I am trying to work with a list box within the table Jobs. The list comes from the other table, Clients​.

    The problem is that
    sometimes I just don't get to make a query that shows just one of the clients. That is, I have Client1, Client2, Client3 etc. I have a field also named Client in the other table (Jobs). It works to insert records into the table Jobs, but when I try a query, sometimes it works, but many times it doesn't.

    For instance: I want a query showing all the records of Client 3 and I know Client3 is present at the table Jobs, but the query doesn't show anything.

    What in the world am I doing wrong? This is driving me crazy!!! What are the details I must observe carefully so I can get a query out of a table with a list box? Thanks!

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,521
    if you mean, select Client3 in the list box, and open the query to see his data?,
    Then the listbox would have 2 columns: clientID, ClientName
    the listbox MUST be bound to col1 (clientID above example) or else it wont find it in tJobs.

    the query:
    select * from tJobs where [clientID]=forms!myForm!listBox

    is this the scenario?

  3. #3
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,815
    Provide the SQL statement of attempted query.

    As ranman shows, reference a control on form to input filter criteria. This control (listbox or combobox) would be UNBOUND.
    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.

  4. #4
    ssanfu is offline Master of Nothing
    Windows 7 32bit Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    Quote Originally Posted by lbcarvalho View Post
    Hi! I have two tables: Clients and Jobs. I am trying to work with a list box within the table Jobs.

    Do you
    mean in table design view you are trying to set up a "List Box/Combo box"?
    If Yes,
    DON'T!!

    See: The
    Evils of Lookup Fields in Tables

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

Similar Threads

  1. Replies: 8
    Last Post: 12-13-2017, 10:38 AM
  2. Replies: 3
    Last Post: 05-10-2017, 12:45 PM
  3. Replies: 14
    Last Post: 10-25-2014, 02:19 PM
  4. Dropdown list drops in the wrong place
    By parishpete in forum Forms
    Replies: 35
    Last Post: 11-03-2012, 08:03 AM
  5. Compile Error: Can't find out what's wrong with the code.
    By vickan240sx in forum Programming
    Replies: 4
    Last Post: 05-24-2012, 06:25 PM

Tags for this Thread

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