Easy Visual Basic Question....
Results 1 to 6 of 6

Thread: Easy Visual Basic Question....

  1. #1
    Registered User DVader's Avatar
    Join Date
    Jan 2001
    Location
    UT,USA
    Posts
    190

    Post Easy Visual Basic Question....

    How do I set an option button so it is automatically selected and is the default button when a form loads?
    It is located in a group of 6 other option buttons in a frame.

  2. #2
    Registered User
    Join Date
    Aug 2000
    Location
    Middle of nowhere
    Posts
    473

    Post

    You set the tabindex property of the button to 0 and consecutively after that. Hope that helps.

  3. #3
    Registered User
    Join Date
    Dec 2000
    Location
    Circle Pines,MN,USA
    Posts
    805

    Post

    if the option where named "option"

    If I were in front of a compiler I could tell you FOR SURE.

    on the load sub

    sub form_load
    option(N).selected=true
    end sub
    where N is the index in the array.

    I'll post back the right answer if I am wrong.

  4. #4
    Registered User
    Join Date
    Sep 2000
    Location
    Kutztown, PA
    Posts
    234

    Post

    Private Sub Form_Load()
    optButton.Value = True
    End Sub

    where optButton is the name of the button you want selected

    CJK's suggestion also works

  5. #5
    Registered User
    Join Date
    Dec 2000
    Location
    Circle Pines,MN,USA
    Posts
    805

    Post

    Yeah those two are right...don't use my suggestion for selected isn't even a value in an option. I suck.

  6. #6
    Registered User
    Join Date
    Mar 2001
    Location
    muskoka,ontario
    Posts
    385

    Post

    that sounds right.. boy its been a while since ive had to call forth the VB code from the recesses of high skool programming(in fact, it was just last year!!)

Bookmarks

Posting Permissions

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