G
gmcnaugh
Hi,
I’m hoping someone can help with this. I have a workbook with some 80
user forms each one containing up to 40 command buttons. I would like
to add another command button which when pressed will reset all of the
other buttons to false. THis function will enable the user to
'refresh' the form should he make a mistake. I do not want to reload
(Unload Me) the form as there is some information pre popluated which
has to be kept.
I have been scouring the internet for a couple of days now and the
closest I have come is:
Private Sub ClearAllTextboxes()
Dim objTemp As Control
For Each objTemp In Me.Controls
If TypeOf objTemp Is TextBox Then objTemp.Text = ""
Next
End Sub
This code as you can see was used to clear text from various text
boxes on a form, however, by substituting “TextBox” for
“CommandButton” and “.Text = “”” for “.Visible = False”I can get all
of the buttons to disappear, including the “Reset Button” which makes
me think this piece of code would suit if only I knew what should be
used in place of “.Text = “””
I am using Boolean with the commandbuttons.
Hope you can help.
Thanks.
I’m hoping someone can help with this. I have a workbook with some 80
user forms each one containing up to 40 command buttons. I would like
to add another command button which when pressed will reset all of the
other buttons to false. THis function will enable the user to
'refresh' the form should he make a mistake. I do not want to reload
(Unload Me) the form as there is some information pre popluated which
has to be kept.
I have been scouring the internet for a couple of days now and the
closest I have come is:
Private Sub ClearAllTextboxes()
Dim objTemp As Control
For Each objTemp In Me.Controls
If TypeOf objTemp Is TextBox Then objTemp.Text = ""
Next
End Sub
This code as you can see was used to clear text from various text
boxes on a form, however, by substituting “TextBox” for
“CommandButton” and “.Text = “”” for “.Visible = False”I can get all
of the buttons to disappear, including the “Reset Button” which makes
me think this piece of code would suit if only I knew what should be
used in place of “.Text = “””
I am using Boolean with the commandbuttons.
Hope you can help.
Thanks.