Results 1 to 3 of 3
  1. #1
    Join Date
    May 2014

    Unanswered: Cannot get a query to work in Access/VBA

    Some background: frontend-MS Access 2010/VBA; backend-MS SQL Server 2008.

    I have a form that has combo box field labeled Supplier. When the down
    arrow is pressed a list of suppliers is given from which one is chosen.
    This uses the SupplierMaster table. This part works fine.

    Here is what I cannot get to work. I have a query written on another
    table (Evaluations table) that has field named Supplier. I want
    to select all table entries that match on supplier and display them.

    Any help is appreciated.

    SupplierID int
    Supplier varchar(50)

    EvalID int
    EvalStatus char(1)
    Supplier varchar(50)
    EvalFY char(2)
    EvalQtr char(1)

    Supplier: Acme Supply

    (Get Evaluations)

    EvalID EvalStatus Supplier EvalFY EvalQtr
    1 C Acme Supply 2013 4
    3 C Acme Supply 2014 1
    5 D Acme Supply 2014 2

  2. #2
    Join Date
    Apr 2014
    Provided Answers: 23
    build a query with the fields you need and add this criteria under [SUPPLIERID]

    this will read your form (Myform) at whats in the combo (cboSupplier)

  3. #3
    Join Date
    Nov 2004
    out on a limb
    Provided Answers: 59
    revisit your design
    use the ID of the supplier from the SupplierMaster table as the foreign key in Evaluations

    whilst you are at it then define a relationship between the Supplier Master and the Evaluations
    then when you come to write your query it will be a heck of a lot easier.
    I'd rather be riding on the Tiger 800 or the Norton

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts