MrExcel Publishing
Your One Stop for Excel Tips & Solutions

Some Controls On UserForm Retains Data - How Do I Stop This??


Posted by Angie Dickinson on January 22, 2002 3:51 AM

Hello,

I have 2 combo boxes on my form along with other controls. When I click on Add Record to update the worksheet, I get a message box asking if I want to add another record. When I click on Yes, the userform reappears with all the other controls on the form blank, except for the 2 combo boxes, these still have the data from the previous transaction. Is there any way I can get around this?

Angie


Posted by Bariloche on January 22, 2002 4:50 AM

Angie,

Not sure what you mean by "get around this." If you want to "clear" the combo boxes the command is MyComboBox.Clear.


have fun

Posted by Angie Dickinson on January 22, 2002 9:48 AM

Hi Bariloche,

I used the command as you suggested, but it is not working. I was wondering if this has anything to do with the fact that the data from combobox1 & 2 goes to textbox1 which is used to update the worksheet. I am just a beginner so I am sort of feeling my way through this.

Check this code and see if there is anything that can be added to help

If vbYes Then
Payno.text = ""
Bookno.text = ""
Textbox1.text =combobox1.value & comboxbox2.value
Textbox2.text =""

Textbox1.setfocus

Else

End
End If