Results 1 to 8 of 8

Thread: Option--Why it defaults to option1(0)?

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Oct 2000
    Posts
    303
    Regarding the option1. If I have three options in
    my form (option1(0) - option1(2), why when I load
    the form, option1(0) is always the default (selected)?

    Can I do something so that none is selected until the
    user click on them?

    Again, thanks for all of you great HELP, folks!

  2. #2
    Hyperactive Member
    Join Date
    Apr 2000
    Location
    Isle of Man
    Posts
    276
    I think that something has to be selected at all times

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Oct 2000
    Posts
    303

    What I am trying to do


    'What I am trying to do is that if the user clicks
    ' on certain option, then run that program. And
    ' option1(0) is a valid option, but yet it will
    ' call the option1_Click() when I load the form, and
    ' I don't want to run option1(0) until the user is
    ' actually click on it.

    Private Sub Option1_Click(Index As Integer)
    ' will come here when the form is loaded! Why?

    End Sub

    Again, thanks alot for the help!


  4. #4
    The Devil crptcblade's Avatar
    Join Date
    Aug 2000
    Location
    Quetzalshacatenango
    Posts
    9,091
    I suggest choosing the option then using a command button or something to determine which option is selected, then do whatever
    Laugh, and the world laughs with you. Cry, and you just water down your vodka.


    Take credit, not responsibility

  5. #5

    Thread Starter
    Hyperactive Member
    Join Date
    Oct 2000
    Posts
    303

    I think this is a bug

    Because it does not work like that for all others
    option that is placed individually.

    Otherwise, the option1_click() really should have been
    option1_default() and/or option1_bug().

  6. #6
    Hyperactive Member
    Join Date
    Oct 2000
    Posts
    400

    Workaround

    Create a module level boolen variable called something like mblnSkipFirst and set it to true in the Form_Load event.

    At the beginning of the Option_Click, add:

    Code:
    If blnSkipOnce Then
      blnSkipOnce = False
      Exit Sub
    End If

  7. #7
    New Member
    Join Date
    Nov 2000
    Location
    Montreal, Canada
    Posts
    14
    try this:

    In the Activate event of your form add this:

    Dim x as Integer

    For x = 0 To 2
    Option1(x).Value = False
    Next
    File not found!
    Abort, Retry, Get a Beer...

    L8r

  8. #8

    Thread Starter
    Hyperactive Member
    Join Date
    Oct 2000
    Posts
    303
    Thanks. That sounds like something I could easily do.

Posting Permissions

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



Click Here to Expand Forum to Full Width