B Bill Case Nov 7, 2003 #1 How can I code a button to clear (erase) the selections made in multiple combo boxes on the form? Thank you very much.
How can I code a button to clear (erase) the selections made in multiple combo boxes on the form? Thank you very much.
R Ragnar Midtskogen Nov 7, 2003 #2 If the combos are bound, that is, based on fields in the form's recordssource, you can just put the following in the button proc: Me.Undo Me.Undo If they are unbound you have to set each control to Null or a zero length string (""). Ragnar
If the combos are bound, that is, based on fields in the form's recordssource, you can just put the following in the button proc: Me.Undo Me.Undo If they are unbound you have to set each control to Null or a zero length string (""). Ragnar
G Gary Miller Nov 7, 2003 #3 Bill, I assume this is for your search form and they are all unbound. Try... Dim ctl as Control On Error Resume Next ' You will throw errors on labels and such, just ignore. For Each ctl In Me.Controls ctl.Value = Null Next ctl -- Gary Miller Gary Miller Computer Services Sisters, OR ________________________
Bill, I assume this is for your search form and they are all unbound. Try... Dim ctl as Control On Error Resume Next ' You will throw errors on labels and such, just ignore. For Each ctl In Me.Controls ctl.Value = Null Next ctl -- Gary Miller Gary Miller Computer Services Sisters, OR ________________________
B Bill Case Nov 7, 2003 #4 Hi Ragnar . . . Thanks for your advice. The boxes are unbound. Can you kindly provide me with the code to set the fields to null? I'm quite new to VB (as in, I know what I know based on people giving me code!).
Hi Ragnar . . . Thanks for your advice. The boxes are unbound. Can you kindly provide me with the code to set the fields to null? I'm quite new to VB (as in, I know what I know based on people giving me code!).