Results 1 to 11 of 11
  1. #1
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    menage event option button... (2000 sr-1)

    I have this userform with many optionbutton...
    I have se is possible to click in each optionbutton in the same time.. but for each optionbutton i have assigned for example: Call SETTORI
    Naturally if i cick on the first optionbutton the macro SETTORI start, if i click on second start other macro... and in this case the application go in error ...

    Is possible to permit the on the next optionbutton only when the first macro is finished...
    Hope understand me...

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: menage event option button... (2000 sr-1)

    You could define a variable PreventClick at the top of the module:

    Private PreventClick As Boolean

    Change OptionButton9_Click as follows:

    Private Sub OptionButton9_Click()
    ' Get out if another event procedure is already running
    If PreventClick = True Then Exit Sub
    ' Tell VBA we're busy
    PreventClick = True

    ' your code goes here
    ...

    ' Tell VBA we're done
    PreventClick = False
    End Sub

    and similar for the other ones.

  3. #3
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: menage event option button... (2000 sr-1)

    Hans dubt on this... i have insert your code il all option buton but the user can click on a optionbutton while other is clicked and not have finished the macro!?!

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: menage event option button... (2000 sr-1)

    Yes, but it won't do anything. If you wish, you can set the option button back to False if PreventClick is True.

  5. #5
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: menage event option button... (2000 sr-1)

    About this form how to force to skip the cursor in textbox4 if the data is completed in textbox3...?
    ...or if the date is completed in textbox3 with the tab key skip the cursor in textbox4

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: menage event option button... (2000 sr-1)

    Sorry, I don't understand. After entering a date in TextBox3, you can press Tab or Enter to move to TextBox4. Is that not what you want?

  7. #7
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: menage event option button... (2000 sr-1)

    Hans exlude ENTER key for problem...
    I think two way...

    or count the lenght of sting in textbox3 autotmaticly after the last digit (the 10

  8. #8
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: menage event option button... (2000 sr-1)

    You could set focus to TextBx4 after the user has entered 10 characters, but I would find that very irritating, because it makes it difficult to correct a mistake - each time you type a correction, the focus shifts away from the text box.

    > or when i have finished to insert date in textbox3 after if i press tab key go to near textbox4.
    That is what happens now, isn't it?

  9. #9
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: menage event option button... (2000 sr-1)

    OK, yes for this: > or when i have finished to insert date in textbox3 after if i press tab key go to near textbox4.

  10. #10
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: menage event option button... (2000 sr-1)

    I'd leave it as it is then.

  11. #11
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: menage event option button... (2000 sr-1)

    ok my Capitain!

Posting Permissions

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