Results 1 to 4 of 4

Access Codes

  1. #1
    Probie is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Apr 2013
    Posts
    5

    Access Codes

    Hi guys, im new to access so be nice



    I need some advised on how to get the following:

    On a form i have box a, and box b, i need to have something that says if box a has x in it & box b has y in it then show z.

    hope i have explained it easier enough, i know the basics of access i just cant get the the form to look at two boxes

    thanks, andrew

  2. #2
    Bob Fitz is offline Access Developer
    Windows XP Access 2003
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    2,102
    Try the following line as the setting for the Control Source property of the control that will show "z".
    =IIF([a] = "x" AND [b] = "y", "z","")
    If this helped, please click the star at the bottom left of this posting and add to my reputation. Many thanks.
    Not everyone can access an accdb, you may reach a broader audience by attaching in mdb format.

    Bob Fitzpatrick

    I have never failed. I have found a thousand ways that do not work!

    Microsoft Community Contributor Award (2011)



  3. #3
    Probie is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Apr 2013
    Posts
    5
    Thank you very much, this helps a great deal, can you put this in more than once in the same control source for more options?

  4. #4
    Dunro is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Feb 2011
    Location
    Toronto, Canada
    Posts
    39
    If you're using multiple criteria, consider using switch...

    switch([a] = "x" And [b] = "y","z",[a] = "w" And [b] = "v","z",1=1,"")

    It will show the results of the first match (I use 1=1 as a catch-all "Else" in this case).

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

Similar Threads

  1. Show Count from different Zip Codes
    By jo15765 in forum Queries
    Replies: 6
    Last Post: 04-15-2013, 12:36 PM
  2. Queries and codes
    By alliandrina in forum Queries
    Replies: 2
    Last Post: 05-03-2012, 05:53 PM
  3. Replies: 1
    Last Post: 03-29-2012, 01:25 AM
  4. Zip Codes
    By Laurie B. in forum Access
    Replies: 6
    Last Post: 02-25-2011, 02:38 PM
  5. Visual Mapping Using Zip Codes?
    By kalisti in forum Reports
    Replies: 1
    Last Post: 01-03-2011, 07:26 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
  •  
Tech Forums: Microsoft Office Forums