Results 1 to 5 of 5
  1. #1
    Jaron is offline Advanced Beginner
    Windows 8 Access 2010 32bit
    Join Date
    Jun 2013
    Posts
    63

    how do I write "if" criteria?

    Hi,


    can anyone tell me how to say the following:

    if [field1] equals "no", don't show anything, except if [field2] says "yes", in which case show it anyway.

  2. #2
    rzw0wr is offline I will always be a newbie
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2013
    Location
    Indiana
    Posts
    479
    try,
    Iif([field1]="NO" AND [Field2] = "YES", field1.visible=true,field1.visible=false)

    Dale

  3. #3
    Jaron is offline Advanced Beginner
    Windows 8 Access 2010 32bit
    Join Date
    Jun 2013
    Posts
    63
    In the query, in design view, do I write this in the criteria for field 1 or 2?

  4. #4
    rzw0wr is offline I will always be a newbie
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2013
    Location
    Indiana
    Posts
    479
    What I gave you won't work. Sorry.

    In field1 type ="NO" - in field2, on the SAME line type ="Yes"
    Make sure the field1 is before field2 in the query.

    Inputting criteria on the same line = an AND. Criteria not on the same line = an OR.


    Dale

  5. #5
    Jaron is offline Advanced Beginner
    Windows 8 Access 2010 32bit
    Join Date
    Jun 2013
    Posts
    63
    Excellent! Thank you!

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

Similar Threads

  1. Replies: 11
    Last Post: 03-29-2012, 02:32 PM
  2. Replies: 4
    Last Post: 03-23-2012, 01:18 PM
  3. Write "Edit List Items.." data back to original form.
    By ngahm in forum Database Design
    Replies: 33
    Last Post: 02-27-2012, 06:54 PM
  4. Passing criteria "NULL" or "IS NOT NULL" to a query
    By SgtSaunders69 in forum Forms
    Replies: 1
    Last Post: 12-24-2011, 02:22 AM
  5. Replies: 2
    Last Post: 05-17-2011, 02:40 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