Results 1 to 10 of 10
  1. #1
    maax555 is offline Novice
    Windows 10 Office 365
    Join Date
    Jan 2024
    Posts
    5

    Query Builder Filter

    Hi All, I have a simple for where I want part number combo box to filter and only show part numbers which belong to the customer combo box,
    The part numbers have already been added against customers in table PartNumber.
    I was trying to achieve this in the criteria section but no luck.



    I have attached the db as the two small images I tried to upload (56kb in total) were generating an error in character length allowed.

    So the form EngineeringTable has the combo box part number which I wish to restrict to only part numbers associated with the customer combo box.

    Customer and partnumber data are in the PartNumber table.

    Many thanks
    Attached Files Attached Files

  2. #2
    moke123's Avatar
    moke123 is offline Me.Dirty=True
    Windows 11 Office 365
    Join Date
    Oct 2012
    Location
    Ma.
    Posts
    1,654
    Google cascading combo boxes.

    Make sure your parts combo has the customers field in it's recordsource and set the customer combo as the criteria for that field. Do a requery in the after update of the customer combo
    If this helped, please click the star * at the bottom left and add to my reputation- Thanks

  3. #3
    Join Date
    May 2018
    Location
    Living in Scotland UK
    Posts
    1,566
    Hi

    As mentioned you need to use Cascading Combobox's.

    To be able to use Cascading correctly you first need to get rid of all the Lookup Fields in your tables.

    Google "The Evil's of Lookupp Fields in Access Tables" for an explanation as to why you should not use them.
    You can PM me if you need further help.
    Good Reading https://docs.microsoft.com/en-gb/off...on-description

  4. #4
    maax555 is offline Novice
    Windows 10 Office 365
    Join Date
    Jan 2024
    Posts
    5
    Quote Originally Posted by moke123 View Post
    Google cascading combo boxes.

    Make sure your parts combo has the customers field in it's recordsource and set the customer combo as the criteria for that field. Do a requery in the after update of the customer combo

    Many thanks for your reply. However I am not able to make this work.

    Its been many years since I used Access and I am struggling more than I anticipated.

    thanks

    EDIT. my screen had not refreshed so I did not see mike's post. I will check this out.

    EDIT 2. The googled search takes me https://access.mvps.org/access/lookupfields.htm this is not reachable.

    thanks

  5. #5
    moke123's Avatar
    moke123 is offline Me.Dirty=True
    Windows 11 Office 365
    Join Date
    Oct 2012
    Location
    Ma.
    Posts
    1,654
    here ya go.
    Attached Files Attached Files
    If this helped, please click the star * at the bottom left and add to my reputation- Thanks

  6. #6
    maax555 is offline Novice
    Windows 10 Office 365
    Join Date
    Jan 2024
    Posts
    5
    Quote Originally Posted by moke123 View Post
    here ya go.
    Thank you, I had something similar but not close enough.

  7. #7
    maax555 is offline Novice
    Windows 10 Office 365
    Join Date
    Jan 2024
    Posts
    5
    [QUOTE=mike60smart;521570]Hi

    As mentioned you need to use Cascading Combobox's.

    To be able to use Cascading correctly you first need to get rid of all the Lookup Fields in your tables.


    Am I correct in thinking that instead of the lookups in tables I would use a combobox on the form?
    This is the way I kind of remember doing in in the past. The lookup wizard in the tables is something I had not seen before so thought this must be the way to go now.

  8. #8
    Join Date
    May 2018
    Location
    Living in Scotland UK
    Posts
    1,566
    Hi
    The field in the table is a Number data type and you would remove the Lookup.

    And, Yes you would create a Combobox on the Form and then store the ID value vice the text.
    You can PM me if you need further help.
    Good Reading https://docs.microsoft.com/en-gb/off...on-description

  9. #9
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,801
    Lookups in tables are just a way to avoid having to make the necessary and properly related tables. They also support the ability for users to muck about in the tables directly, which is another thing that is generally considered to be bad practice. While you might have combos on a form, they're not used in place of table lookup fields. They're used in conjunction with properly designed db schema and that means having the right tables with the right fields for the job.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  10. #10
    moke123's Avatar
    moke123 is offline Me.Dirty=True
    Windows 11 Office 365
    Join Date
    Oct 2012
    Location
    Ma.
    Posts
    1,654
    The lookup wizard in the tables is something I had not seen before so thought this must be the way to go now.
    There are a few of those gems (snark) that make it easy to do one thing, but it complicates 10 others.
    If this helped, please click the star * at the bottom left and add to my reputation- Thanks

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

Similar Threads

  1. Replies: 11
    Last Post: 06-16-2022, 08:45 AM
  2. Query Builder want to filter by Check Box
    By crimedog in forum Queries
    Replies: 2
    Last Post: 01-15-2020, 03:32 PM
  3. Replies: 3
    Last Post: 09-14-2015, 02:04 PM
  4. Replies: 2
    Last Post: 03-22-2015, 11:16 AM
  5. Macro Builder and Code Builder
    By data808 in forum Macros
    Replies: 2
    Last Post: 01-12-2014, 11:28 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