Results 1 to 11 of 11
  1. #1
    DavidMcArthur is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Jun 2016
    Posts
    18

    Query Criteria Issue

    Hi All,

    I have a big database which we use for Purchase Order Numbers and Job Reference Numbers.

    When we go to issue a purchase order I have to choose the product from a list but the problem is it will show ALL items. Is there a way I can choose the Supplier First and have the products to that supplier filtered?

    I know there will be a few more questions to be answered on this...



    Its one of the last bits I need to get right.

    Click image for larger version. 

Name:	1.PNG 
Views:	29 
Size:	23.4 KB 
ID:	34893

  2. #2
    Minty is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2017
    Location
    UK - Wiltshire
    Posts
    3,157
    You need cascading combo boxes. Have a look here for a sample and code
    http://www.baldyweb.com/CascadingCombo.htm
    DLookup Syntax and others http://access.mvps.org/access/general/gen0018.htm
    Please use the star below the post to say thanks if we have helped !
    ↓↓ It's down here ↓↓

  3. #3
    DavidMcArthur is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Jun 2016
    Posts
    18
    Yes! this looks like it. I cant get it to work on my database though.... Here is the relationship which links into the photo I posted earlier. Click image for larger version. 

Name:	1.PNG 
Views:	28 
Size:	33.2 KB 
ID:	34897

  4. #4
    Minty is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2017
    Location
    UK - Wiltshire
    Posts
    3,157
    What is the query used for the product combobox , you need to add the SupplierCmbo as a criteria in your Product combo.
    If you post up the names of your forms, and the SQl of the query we may be able to help.
    DLookup Syntax and others http://access.mvps.org/access/general/gen0018.htm
    Please use the star below the post to say thanks if we have helped !
    ↓↓ It's down here ↓↓

  5. #5
    orange's Avatar
    orange is offline Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,870
    A few comments re design of tables and relationships for consideration:
    -suggest no spaces in field names
    -PurchaseOrder table should have a PK
    - would include AgreedTo or pricePaid field in table Order_Line
    If you don't include a Price in Order_Line, and you depend on Price in Product, you will get an error in any historic info. That is, when you change a Product price, the new value will be used for existing Orders/OrderLines which will not(necessarily) be the Price at the time of the Purchase.

  6. #6
    DavidMcArthur is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Jun 2016
    Posts
    18
    Hi Orange,

    The point you made about price is a good one. I struggled with this so what I did was create a new product everytime the price changes and then untick "Active" which is a check box. This will keep all historical data but hide it so it doesn't get confusing.

  7. #7
    DavidMcArthur is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Jun 2016
    Posts
    18
    Click image for larger version. 

Name:	1.PNG 
Views:	21 
Size:	13.6 KB 
ID:	34914

    Here are my form names. I removed all query data because its giving an error

  8. #8
    Minty is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2017
    Location
    UK - Wiltshire
    Posts
    3,157
    Is there a new question or is this solved ?
    I'm a little confused.
    DLookup Syntax and others http://access.mvps.org/access/general/gen0018.htm
    Please use the star below the post to say thanks if we have helped !
    ↓↓ It's down here ↓↓

  9. #9
    DavidMcArthur is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Jun 2016
    Posts
    18
    Not been resolved.

  10. #10
    Minty is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2017
    Location
    UK - Wiltshire
    Posts
    3,157
    So where are you with it.
    What have you tried - what code / SQL query is being used , and what errors are you getting?
    DLookup Syntax and others http://access.mvps.org/access/general/gen0018.htm
    Please use the star below the post to say thanks if we have helped !
    ↓↓ It's down here ↓↓

  11. #11
    orange's Avatar
    orange is offline Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,870
    As Minty said earlier, when you need to Select a Product from a Supplier, you would normally use a form. And on the form would be 2 comboboxes.
    The first combo would be a list of Suppliers - and you would select one.
    The second combo contains a list of Products-BUT -only those Products supplied by the Supplier you selected in the first combo.
    This approach is known as Cascading Combos.

    Post your current status. We can't help you unless you provide feedback to our questions.

    Some links to help:
    http://www.fmsinc.com/microsoftacces...cascading.html

    These 2 from DataPig are older, but lead you through the entire set up.
    http://www.datapigtechnologies.com/f...combobox1.html
    http://www.datapigtechnologies.com/f...combobox2.html

    Good luck

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

Similar Threads

  1. Criteria issue with DCount
    By JimO in forum Access
    Replies: 10
    Last Post: 08-29-2017, 11:56 AM
  2. Replies: 1
    Last Post: 05-18-2012, 11:59 AM
  3. Replies: 3
    Last Post: 03-14-2012, 10:31 AM
  4. Criteria Issue
    By RichardS in forum Queries
    Replies: 3
    Last Post: 09-16-2010, 09:19 PM
  5. Criteria or Filter Issue
    By MichaelW in forum Queries
    Replies: 1
    Last Post: 07-06-2010, 01:43 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