Results 1 to 5 of 5
  1. #1
    Darla is offline Novice
    Windows 10 Access 2013 32bit
    Join Date
    May 2016
    Posts
    25

    using Iif on a form, having an issue?

    Hi everyone! I have a form that currently has a button, where if you click it, it will open "Form 1", no problem. But I want to add a little bit to it. I have another field in the form, where if the value is "77", then I need the click to open "Form 2", but otherwise if it's anything else, "Form 1" like usual. I've been struggling with this and can't seem to figure out how to do it, could someone point me in the right direction please?

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Show us what you have for the button that works.

  3. #3
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,549
    Code:
    Sub btn_click()
      If me.field = "77"  then
          Docmd.openform "form2"
      Else
         Docmd.openform "form1"
      end if
    end sub

  4. #4
    Darla is offline Novice
    Windows 10 Access 2013 32bit
    Join Date
    May 2016
    Posts
    25
    Thank you!

  5. #5
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    I marked this thread as *Solved* for you using the *Thread Tools* at the top of the thread.
    https://www.accessforums.net/showthread.php?t=1828

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

Similar Threads

  1. Printing issue form a form (MS Access 2010)
    By gutenberg in forum Forms
    Replies: 7
    Last Post: 06-23-2016, 12:47 PM
  2. Replies: 5
    Last Post: 01-08-2015, 02:08 PM
  3. Replies: 3
    Last Post: 03-17-2014, 10:23 AM
  4. Replies: 22
    Last Post: 05-21-2013, 07:54 PM
  5. Relationship issue on my form
    By BigMac4 in forum Access
    Replies: 4
    Last Post: 08-30-2012, 07:27 AM

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