Consulting

Results 1 to 4 of 4

Thread: Solved: Radio button is not working - variable not defined

  1. #1

    Solved: Radio button is not working - variable not defined

    I keep on getting 'Variable not defined' on Button3 when i execute my codes. What seems to be the problem? I already made sure the *name* properties of the button on the worksheet is set to Button3.

    If Button3.Value = True Then
    MsgBox "TESTING"
    End If

  2. #2
    Moderator VBAX Guru Simon Lloyd's Avatar
    Joined
    Sep 2005
    Location
    UK
    Posts
    3,003
    Location
    Is the button off the forms toolbox or the controls toolbox?
    Please supply any code you are working with in relation to this button as that should be fine if you have the button called Button3, but default is OptionButton3
    Regards,
    Simon
    Please read this before cross posting!
    In the unlikely event you didn't get your answer here try Microsoft Office Discussion @ The Code Cage
    If I have seen further it is by standing on the shoulders of giants.
    Isaac Newton, Letter to Robert Hooke, February 5, 1675 English mathematician & physicist (1642 - 1727)

  3. #3
    Quote Originally Posted by Simon Lloyd
    Is the button off the forms toolbox or the controls toolbox?
    Please supply any code you are working with in relation to this button as that should be fine if you have the button called Button3, but default is OptionButton3
    It's from the control tool box.

    I have a button on the worksheet that links the actual codes of the entire VBA program. If a user click this button, the program will run. So the program codes are stored in under the 'Modules' folder.

    I then created another radio button on the worksheet.

    Codes are like.

    Do
    blahblahblah
    Loop Until X = 12345

    If button3.value = true then
    do this
    end if

    Msgbox ("values are " & blabhalbah)

  4. #4
    Oh I figured it out.

    The original button with all the program codes is in Form, and my radio button is in Active X.

    I rebuilt the original button in Active X mode and button3.value works now.

    If button3.value = true then
    do this

    end if

Posting Permissions

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