none
"Do not ask me this again" checkbox RRS feed

  • Question

  • I have a user form that is designed to pop up everytime a certain macro is executed. It comes up to promt the user the check and enable a certain setting. The problem is, I dont want the box to pop up if the user selects the 'do not show me this again' checkbox located on the form and then hits yes.

     Here is the code for the 'yes' the 'no' and the checkbox so far:

    Private Sub CheckBox1_Click()

    End Sub

    Private Sub NOButton_Click()
        End
    End Sub

    Private Sub YESbutton_Click()
        If CheckBox1 = True Then


        Else
        Attention.Hide
        End If
    End Sub

    Any ideas? Thanks

    Monday, June 6, 2011 3:30 PM

Answers

  • In addition to what Tony has mentioned here are two other ways.

    1. In the macro that that calls the form declare a public boolean variable. When its value is False show the form. When the user checks the box to not show, set the value of the variable to True.

    2. When the user chooses to not to show the form set a document variable. Prior to showing the form, check the document variable.

     


    Kind Regards, Rich ... http://greatcirclelearning.com
    Monday, June 6, 2011 4:17 PM

All replies

  • If you want to act based on previous user input, you must remember what that was. There is a built-in way to do this in VBA, which saves settings in the registry - look up the SaveSetting and GetSetting commands.
     

    Enjoy,
    Tony
    www.WordArticles.com
    Monday, June 6, 2011 3:56 PM
  • In addition to what Tony has mentioned here are two other ways.

    1. In the macro that that calls the form declare a public boolean variable. When its value is False show the form. When the user checks the box to not show, set the value of the variable to True.

    2. When the user chooses to not to show the form set a document variable. Prior to showing the form, check the document variable.

     


    Kind Regards, Rich ... http://greatcirclelearning.com
    Monday, June 6, 2011 4:17 PM
  • Thanks, i used the boolean variable method and it worked fine.
    Monday, June 6, 2011 6:16 PM