Results 1 to 3 of 3
  1. #1
    crowegreg is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Posts
    398

    set option button to true

    On a form I have 10 option buttons. Named option1, option2, option3..

    If I create a recordset which the contains the option buttons I would like set to true, what is the sytax for setting that option button to true?

    An example, if my recordset returns the following:
    option3
    option7


    option9

    Normally I would just use the command me.option3=true. What's the syntax within the loop for setting those options to true?

  2. #2
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,018
    Me.Option3 = True or Me.Option3 = -1 should both work, although I always use the latter. Don't remember the whys and wherefores, but there are some situations where the former confuses the Access Gnomes!

    But I'm not exactly sure of what your question is here!

    ...If I create a recordset which the contains the option buttons I would like set to true, what is the sytax for setting that option button to true?

    ...What's the syntax within the loop for setting those options to true?
    What loop? What, exactly, are you trying to do here?

    Linq ;0)>
    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

  3. #3
    crowegreg is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Posts
    398
    I found the solution on another board. Here's my solution
    Me.Controls("Option" & stra0) = True

    The variable stra0 has been assigned the record from the recordset

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

Similar Threads

  1. sort option button
    By turk in forum Access
    Replies: 9
    Last Post: 03-08-2012, 03:16 PM
  2. Option/Radio Button Problem
    By benthamq in forum Forms
    Replies: 6
    Last Post: 09-16-2011, 09:48 AM
  3. Option button to apply filter
    By catguy in forum Programming
    Replies: 4
    Last Post: 06-23-2011, 12:10 PM
  4. Option Button with Negated Value
    By rohnds in forum Forms
    Replies: 3
    Last Post: 08-09-2010, 07:07 AM
  5. Problem on Option Button
    By cwwaicw311 in forum Forms
    Replies: 2
    Last Post: 02-10-2010, 10:44 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