Results 1 to 4 of 4
  1. #1
    JB510's Avatar
    JB510 is offline Advanced Beginner
    Windows 11 Office 365
    Join Date
    Jan 2023
    Location
    Ontario
    Posts
    42

    Listbox query from Combobox not working.

    I have a combo box (MasterSNcbo) that lists a bunch of parts based on a Table (PartBOMT).
    Ex.

    PartBOMT table looks something like this:
    MasterPN, EngineeringPN, Used
    BOM1 Part1 Yes


    BOM1 Part2 Yes
    BOM1 Part3 Yes
    BOM2 Part1 Yes
    BOM3 Part2 Yes

    When a MasterPN is selected in the combo box (MasterSNcbo), the list box (List3) should update the list of EngineeringPNs based on the query in the list box row source.

    Below is the row source sql:
    SELECT PartBOMT.MasterPN, PartBOMT.Used, PartBOMT.EngineeringPN
    FROM PartBOMT
    WHERE (((PartBOMT.MasterPN)=Forms!Tools4F!MasterSNcbo) And ((PartBOMT.Used)=True));

    The List3 listbox is not updating though when a part is selected.
    I don't know the reason why.
    Note: If I hard code the MasterSNcbo part number in the listbox query (="BOM1") it works but if I use (Forms!Tools4F!MasterSNcbo) it don't.
    Why?

  2. #2
    Micron is online now Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,778
    Use the after update event of the combo to requery the listbox.

    https://learn.microsoft.com/en-us/of...istbox.requery
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  3. #3
    JB510's Avatar
    JB510 is offline Advanced Beginner
    Windows 11 Office 365
    Join Date
    Jan 2023
    Location
    Ontario
    Posts
    42
    TY it works now..
    I thought it would update automatically..
    I entered an After Update in the MasterSNcbo combo box to ..
    Forms!Tools4F!List3.Value = Null
    Forms!Tools4F!List3.Requery

    Thanks.


  4. #4
    Micron is online now Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,778
    Glad I could help.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

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

Similar Threads

  1. Replies: 2
    Last Post: 09-15-2016, 09:50 AM
  2. Replies: 2
    Last Post: 08-10-2015, 06:47 AM
  3. ComboBox, ListBox or something else
    By SSUTTON in forum Access
    Replies: 7
    Last Post: 03-28-2015, 05:44 PM
  4. Combobox Query not working
    By ntaylor95814 in forum Forms
    Replies: 0
    Last Post: 04-15-2014, 04:29 PM
  5. Replies: 1
    Last Post: 09-10-2012, 11:21 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