Access Querry Problem

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ChaseCox
    Contributor
    • Nov 2006
    • 293

    Access Querry Problem

    OK, so what I want to do is probably very simple but I need some help. I would like be able to put something in the criteria section of a query I created that tells it to pull the information that was put into the form I created. For example I have a combo box that allows them to select different product codes, and I want my query to filter the database based on the product code they entered. Any help would be tremendously appreciated!
  • imtmub
    New Member
    • Nov 2006
    • 112

    #2
    Originally posted by ChaseCox
    OK, so what I want to do is probably very simple but I need some help. I would like be able to put something in the criteria section of a query I created that tells it to pull the information that was put into the form I created. For example I have a combo box that allows them to select different product codes, and I want my query to filter the database based on the product code they entered. Any help would be tremendously appreciated!
    In The combobox property in the Event Tab Select after update ---Event Procedure-- and type as follows.

    DoCmd.OpenQuery "Ur Query Name"
    Me.Ur Combobox Name = ""


    Combo box name u can find in property window others tab.

    Comment

    • Killer42
      Recognized Expert Expert
      • Oct 2006
      • 8429

      #3
      Originally posted by ChaseCox
      OK, so what I want to do is probably very simple but I need some help. I would like be able to put something in the criteria section of a query I created that tells it to pull the information that was put into the form I created. For example I have a combo box that allows them to select different product codes, and I want my query to filter the database based on the product code they entered. Any help would be tremendously appreciated!
      I think what you're looking for is something like "= [Forms]![MyForm]![MyCombo].Text". I may not have the syntax entirely correct, but the idea is that your query criteria can refer to the actual value on the form.

      Comment

      • ADezii
        Recognized Expert Expert
        • Apr 2006
        • 8834

        #4
        Originally posted by ChaseCox
        OK, so what I want to do is probably very simple but I need some help. I would like be able to put something in the criteria section of a query I created that tells it to pull the information that was put into the form I created. For example I have a combo box that allows them to select different product codes, and I want my query to filter the database based on the product code they entered. Any help would be tremendously appreciated!
        Assuming your Form Name is frmTest and your Combo Box is named cboTest:
        In the criteria row of the appropriate field of the underlying Query for your Form place =Forms![frmTest]![cboTest]

        Comment

        • NeoPa
          Recognized Expert Moderator MVP
          • Oct 2006
          • 32633

          #5
          If you can provide the names of your form and the control(s) you want to use in this - as well as the fields in the dataset which would need to be compared against, then we can provide you with something to help.

          Comment

          • NeoPa
            Recognized Expert Moderator MVP
            • Oct 2006
            • 32633

            #6
            The posts above should actually give you all you need.
            My thread window had not been updated when I posted so I didn't see these until after my post.

            Comment

            • ChaseCox
              Contributor
              • Nov 2006
              • 293

              #7
              Originally posted by NeoPa
              The posts above should actually give you all you need.
              My thread window had not been updated when I posted so I didn't see these until after my post.
              Thanks guys. I got it.

              Comment

              Working...