UserForm Question

jsartain

New Member
Joined
Mar 24, 2002
Messages
24
I currently am using a userform with a MultiPage and many textboxes and comboboxes. I have a button at the bottom of the userform to reset or clear the textboxes and comboboxes. The problem is that you have to hit the button twice to work. Below is the basic code that I am using. Does anyone know how to make this work by hitting the button only once?

UserForm1.MultiPage1.Value = 0
UserForm1.TextBox1.Value = ""
UserForm1.ComboBox1.Value = "bhp"

Thanks for the help.
 

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
Try clicking on the button (once) then go to the properties window and select the Default property, select true under the pop up list. if this doesnt work, reply and ill try again.
Will
 
Upvote 0
Hi.
If, when your userform is intialized, the values of these textboxes = "" then simply unload and reload your form.

Such as

Unload Me
UserForm1.Show

Think it through if you have other code in this event(initialize)

Tom
This message was edited by TsTom on 2002-04-01 10:00
 
Upvote 0
Thanks for the help, but maybe I should better explain my problem. I have a userform that accepts information in textboxes, but the user might want to start over and clear the textboxes and reset the userform. I used the button to do this function, but you have to hit it twice to work. Is there another way of clearing and reseting information without coming out of the userform?
 
Upvote 0
Hi

I agree with Tom if you just set the clear button to unload and then reload the userform with screen updating turned off then the user will think that the button has cleared all the data and you have the end result you want......

....unless you don't want the clear button to clear all the data, just some of it?

Dan
 
Upvote 0

Forum statistics

Threads
1,214,585
Messages
6,120,399
Members
448,957
Latest member
Hat4Life

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top