Results 1 to 6 of 6
  1. #1
    Join Date
    May 2012
    Posts
    132

    Unanswered: Can this button be made in a form?

    How can we design a button in a form, so that when it is pressed once, it will be inactivated until the form is open again? Or the button is inactivated for a certain time for example 10 seconds?
    ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
    I asked god to please give me everything to enjoy the life, God said: i gave you the life to enjoy everything.

  2. #2
    Join Date
    Mar 2009
    Posts
    5,442
    Provided Answers: 14
    I don't understand the purpose of such an action, but you can use:
    Code:
    Private Sub Command_Inactivate_Click()
    
        ' Cannot disable the control that has the focus
        ' --> Set the focus to another existing control (here Text_Dummy).
        '
        Me.Text_Dummy.SetFocus
    
        ' Disable the command button.
        '
        Me.Command_Inactivate.Enabled = False
        
        ' Start the timer.
        '
        Me.TimerInterval = 10000 ' 10 seconds.
        
    End Sub
    
    Private Sub Form_Timer()
    
        ' Stop the timer
        '
        Me.TimerInterval = 0
        
        ' Enable the command button.
        '
        Me.Command_Inactivate.Enabled = True
        
    End Sub
    Have a nice day!

  3. #3
    Join Date
    Nov 2010
    Posts
    84
    See the example attached.
    Attached Files Attached Files

  4. #4
    Join Date
    May 2012
    Posts
    132
    i did it to prevent the user to click a button repeatedly, and make a record several times inadvertently.
    by the way thank very much for the instructive guide
    ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
    I asked god to please give me everything to enjoy the life, God said: i gave you the life to enjoy everything.

  5. #5
    Join Date
    May 2012
    Posts
    132
    i did it to prevent the user to click a button repeatedly, and make a record several times inadvertently.
    by the way thank very much for the instructive guide
    ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
    I asked god to please give me everything to enjoy the life, God said: i gave you the life to enjoy everything.

  6. #6
    Join Date
    Mar 2009
    Posts
    5,442
    Provided Answers: 14
    You're welcome!
    Have a nice day!

Posting Permissions

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