Results 1 to 3 of 3

Thread: Using Toggle/Option Buttons

  1. #1
    Board Regular gheyman's Avatar
    Join Date
    Nov 2005
    Location
    Orlando, FL USA
    Posts
    1,665
    Post Thanks / Like
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)

    Default Using Toggle/Option Buttons

    I put two option buttons on a form and I am trying to figure out how to use them. Where is the Value stored when one of the Options are selected? I want to use these buttons in an If statement.

    Option246
    Option248

    I tired to test it:
    Private Sub Frame244_Click()
    If Option246.Value = "1" Then
    Text256.Value = "1"
    Else
    Text256.Value = "2"
    End If
    End Sub

    No luck, I get debug error
    G Heyman
    Northrop Grumman - Laser Systems'
    Apopka, FL

  2. #2
    Board Regular
    Join Date
    Sep 2012
    Posts
    131
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Access: Using Toggle/Option Buttons

    I think toggle boxes are either 0 or -1, not 1 or 2.

    Also, i don’t think you should use the quote marks, so Option246.value = 0 then yadda yadda yadda

  3. #3
    Board Regular
    Join Date
    Jul 2010
    Posts
    464
    Post Thanks / Like
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Access: Using Toggle/Option Buttons

    The value is assigned to the frame control:

    Code:
    Private Sub Frame244_Click()
    Select Case Frame244
        Case Is = 1
            Text256 = "1"
        Case Is = 2
            Text256 = "2"
    End Select    
    End Sub
    Or

    Code:
    Private Sub Frame244_Click()
    Text256 = Frame244
    End Sub
    Note that you can view and amend the option numbers on the property sheet of the option control.
    Last edited by stumac; Oct 16th, 2019 at 05:09 AM.

Some videos you may like

User Tag List

Tags for this Thread

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •