exclude records that include given value

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • nickvans
    New Member
    • Aug 2007
    • 62

    exclude records that include given value

    Hello everyone!

    I have a question that should be rather simple, but I haven't been able to figure out a way to do it.

    I have a table which has assembly numbers, and another table with parts that go to these assemblies (1 to many relationship on field AssyNum), as well as a form with several text boxes for the user to input part numbers. If a value is input into a text box, a list on the form shows all AssyNum's that include that part.

    I would like to add functionality to this form to allow a user to specify parts that must NOT be on the assy.

    I tried tweaking the query to read NOT([forms]![frmUserInterfac e]![text1]) in the criteria, but that doesn't seem to do anything -- the query just returns all records.

    Does anyone have a way to accomplish this?

    Thanks!
  • Denburt
    Recognized Expert Top Contributor
    • Mar 2007
    • 1356

    #2
    Have you tried :

    <>([forms]![frmUserInterfac e]![text1])

    Comment

    • Scott Price
      Recognized Expert Top Contributor
      • Jul 2007
      • 1384

      #3
      Using a text box to do this is slightly flawed, since you will only be able to exclude one part/assembly. The syntax to do it is <> Forms![FormName].[TextBoxName]. I would suggest you look into a multi-select listbox instead of the text box, since it will allow you to select multiple part numbers.

      This link gives the code to retrieve values selected from a multi-select listbox.

      Regards,
      Scott

      Comment

      Working...