none
Activate command button if data on userform is changed RRS feed

  • Question

  • Afternoon all

    I have a Useform which shows data from a worksheet. I have a Command Button "Update", but I would only like it to be usable if the displayed data is changed.

    Any Ideas?

    Thanks

    Steve

    Monday, January 14, 2019 1:23 PM

Answers

  • Set the Enabled property of the command button to False in the design window.

    Create an AfterUpdate event procedure for each of the controls that display data from the worksheet. For example:

    Private Sub TextBox1_AfterUpdate()
        Me.cmdUpdate.Enabled = True
    End Sub

    where cmdUpdate is the name of the command button.


    Regards, Hans Vogelaar (http://www.eileenslounge.com)

    • Marked as answer by Stirlingmw Monday, January 14, 2019 3:35 PM
    Monday, January 14, 2019 3:13 PM

All replies

  • Set the Enabled property of the command button to False in the design window.

    Create an AfterUpdate event procedure for each of the controls that display data from the worksheet. For example:

    Private Sub TextBox1_AfterUpdate()
        Me.cmdUpdate.Enabled = True
    End Sub

    where cmdUpdate is the name of the command button.


    Regards, Hans Vogelaar (http://www.eileenslounge.com)

    • Marked as answer by Stirlingmw Monday, January 14, 2019 3:35 PM
    Monday, January 14, 2019 3:13 PM
  • Perfect, Thanks Hans


    Steve

    Monday, January 14, 2019 3:35 PM