Results 1 to 2 of 2
  1. #1
    mnsemple83 is offline Advanced Beginner
    Windows 7 32bit Access 2007
    Join Date
    Jul 2011
    Posts
    40

    Enabling Option Groups using Macros

    I have designed a form for my database and I am trying to create a macro that will enable a control if the value of the first two controls is greater than zero. The controls I am working with are three option groups. Each option in those groups are set to a value.

    Control Names: Question1, Question2, Question3
    Condition: (([Forms]![sbFrmQuestionnaire]![Question1]-1)+([Forms]![sbFrmQuestionnaire]![Question2]-1))>0


    Action: SetProperty
    Arguments: [Question3], Enabled, -1

    I applied it to the OnCurrent property of the form. However, when I set the values that will satisfy the condition, the control does not function correctly (i.e., the control is not enabled). What is wrong with my code?

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    When do you set the values - in the open form? This will not trigger the OnCurrent event. OnCurrent is triggered when opening form or moving to another record.

    Are these controls on a subform? Is this code behind the subform?

    I use only VBA, easier to debug.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

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

Similar Threads

  1. Option Groups and Adding Data to Tables
    By ipitydafool in forum Forms
    Replies: 5
    Last Post: 05-02-2011, 01:59 PM
  2. Working with Radio Buttons and Option Groups
    By queenbee in forum Access
    Replies: 1
    Last Post: 04-29-2011, 02:25 PM
  3. Option Groups - change value from number to text
    By nchesebro in forum Programming
    Replies: 10
    Last Post: 02-09-2011, 03:52 PM
  4. Replies: 3
    Last Post: 11-03-2010, 09:53 AM
  5. Enabling a control and moving to a new tab in vba
    By MuskokaMad in forum Programming
    Replies: 1
    Last Post: 03-14-2010, 05:30 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