Results 1 to 5 of 5
  1. #1
    mahmud1180 is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Sep 2014
    Posts
    20

    Option Group selection

    I want to use option boxes in the from using a if function like

    If (Me!CustomizedDates = True) Then


    D(i) = CD(i)

    ENd if

    Its actually not working. How can I use conditional functions if one option is selected.



    Thanks in advance

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,550
    If your option group has only 1 option , then use a checkbox.
    if it has > 1 option , the VALUE of the item you picked is contained in the FRAME. (the box)

    You place a frame on the form, in the frame you put all your options, each w a different value
    The VALUE of the option picked is assigned to the FRAME.VALUE

    so the frame has
    yes = 1
    no = 0
    maybe = 2

    if user picked MAYBE then
    the frame ,fraPicks.value = 2

    be sure to NAME the objects so they are more understandable, in properties, other tab, NAME.

  3. #3
    mahmud1180 is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Sep 2014
    Posts
    20
    I have two options so I am using option group. I actually have no idea where the frame is. I have put the option group in the form. The options have distinct option value such as 1 and 2. Is it the frame value? or is it in the property of the options?

  4. #4
    mahmud1180 is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Sep 2014
    Posts
    20
    Ah got it ! The whole box is called the frame.... Thanks

  5. #5
    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
    Quote Originally Posted by mahmud1180 View Post

    ...The whole box is called the frame...
    Now you've got it! In an Option Group you always refer to the Frame, itself, not to the individual Controls, whether Checkboxes, Radio Buttons or whatever. Example code would be something like this:
    Code:
    Private Sub ActualFrameName_AfterUpdate()
     
     Select Case Me.ActualFrameName
      
      Case 1  'First Button
         'Code for First Button goes here
      
      Case 2  'Second Button
         'Code for Second Button goes here
      
      Case 3  'Third Button
         'Code for Third Button goes here
     
     End Select
    
    End Sub

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

Similar Threads

  1. Replies: 4
    Last Post: 10-03-2014, 06:36 AM
  2. Replies: 3
    Last Post: 12-02-2012, 09:38 AM
  3. Replies: 5
    Last Post: 08-13-2012, 06:57 AM
  4. Replies: 6
    Last Post: 09-27-2011, 04:39 PM
  5. Replies: 5
    Last Post: 05-17-2011, 11:02 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