Page 2 of 2 FirstFirst 12
Results 16 to 22 of 22
  1. #16
    Micron is offline Very Inert Person
    Windows 7 32bit Access 2007
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    13,423
    Quote Originally Posted by Nadine67 View Post
    Is it possible to do what I want with an if?



    If ComboBox selection = "Cat" then enable page "Cat"
    Else If ComboBox selection = "Dog" then enable page "Dog"
    Else If ComboBox selection = "Bird" then enable page "Bird"

    If so then I still am stumped as to how to write it.
    Basically no. IIF statements cannot affect object properties by themselves. What you suggest is exactly what we're trying to achieve but in the proper (and really, quite simple) method. You are making it harder than it needs to be, so you must not be digesting the posted answers you've been given. As instructed by me and ssanfu, put ALL of the code in the form module. Make sure all of it is the only version you have. At this point, it's not 100% clear to me where you have the third part:
    "And I have this code in a Module BUT how where do I put it on the form?"
    What module? Not the form module? All that you've ever needed to do is have these three parts together - one after the other - in the same place - in the form module and no where else. I tested it before posting, so I know it works if it's set up right.

  2. #17
    Nadine67 is offline Advanced Beginner
    Windows 7 32bit Access 2013 32bit
    Join Date
    Jul 2015
    Posts
    55
    Hello Micron and ssanfu

    I greatly apologise for getting it so wrong, you are correct in saying I didn't understand....because I really didn't.

    I have now done as you both have said and I have gotten the result I would've gotten had I followed the instructions correctly....and it is the result I wanted.

    Sorry to mess you guys around...and I thank you for not giving up on me.

    Cheer

    Nadine

  3. #18
    Nadine67 is offline Advanced Beginner
    Windows 7 32bit Access 2013 32bit
    Join Date
    Jul 2015
    Posts
    55
    I know I am pushing my luck....but... Is it possible to have two pages enabled at all times? My TabControl has 5 pages and I want pages 0 and 4 enabled at all times and pages 1,2,3 only enabled upon selection from the combo box.

  4. #19
    ssanfu is offline Master of Nothing
    Windows XP Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    Of course.
    3 tabs are enabled when you drag the tab control onto the form.
    Add 2 more tabs - all 5 still enabled.
    You manually disable 3 tabs, 2 tabs still enabled. Works same with code.

  5. #20
    Nadine67 is offline Advanced Beginner
    Windows 7 32bit Access 2013 32bit
    Join Date
    Jul 2015
    Posts
    55
    Thank you. I have it sorted.

    Cheers!

  6. #21
    Micron is offline Very Inert Person
    Windows 7 32bit Access 2007
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    13,423
    Quote Originally Posted by ssanfu View Post
    3 tabs are enabled when you drag the tab control onto the form.
    Add 2 more tabs - all 5 still enabled.
    You manually disable 3 tabs, 2 tabs still enabled. Works same with code.
    Not sure about that. As I recall, the request was to enable the tab selected from the combo, so I wrote the code to disable ALL tabs on form opening. I don't get how Nadine67 can say it has been sorted out.

  7. #22
    Nadine67 is offline Advanced Beginner
    Windows 7 32bit Access 2013 32bit
    Join Date
    Jul 2015
    Posts
    55
    Yes you are right in part....the request was to enable 2 of the 4 pages based on selection.

Page 2 of 2 FirstFirst 12
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 10
    Last Post: 09-25-2015, 05:52 AM
  2. Replies: 3
    Last Post: 07-03-2013, 10:38 AM
  3. Replies: 3
    Last Post: 12-02-2012, 09:38 AM
  4. Replies: 1
    Last Post: 10-30-2012, 10:29 AM
  5. Replies: 1
    Last Post: 02-25-2011, 10:03 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