Results 1 to 4 of 4
  1. #1
    Join Date
    Jul 2004
    Posts
    2

    Unanswered: Access 97 Query help!??

    I've created a query in Access in which I want to prompt for a value and if the user does not enter anything it will return all records. I can enter a single value and receive the right records but cannot get a dump of all records. Below is how I have it in the criteria box. I have listed out all the values because I could not figure out a wildcard situation. I'm hoping someone can help??

    (IIf([Enter Product]<>"A" And [Enter Product]<>"B" And [Enter Product]<>"C" And [Enter Product]<>"D" And [Enter Product]<>"E",[Enter Product]="A" & [Enter Product]="B" & [Enter Product]="C" & [Enter Product]="D" & [Enter Product]="E",[Enter Product]))

  2. #2
    Join Date
    Jul 2004
    Posts
    8
    Here is a solution that may work.

    IIf([Enter Product] Is Null,[productColumn],[Enter Product])

    productColumn is the name of the column that you are trying to filter out.

  3. #3
    Join Date
    Jul 2004
    Posts
    2
    That solution works to a point, but It does not dump the records if there is a blank/null value in the column.

  4. #4
    Join Date
    Jul 2004
    Posts
    8
    This will return Null Values with the rest of the statement.

    This is the last line in the SQL statement.

    HAVING (((T1.Field1) Like [enter] Or (T1.Field1)=[field1])) OR (((VarType([field1]))=1))

    T1 is the Table Name
    Field1 is the Column Name
    [Enter Product] is the parameter

Posting Permissions

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