how do i clear the list box using VB code

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

i populated a list box in a form. i need to clear it when i press a command button. i used the following in the VB click () code for the button: Forms!sunform_frm!ListBox_lbx.Value = Null any ideas? ~rl
 
Assuming your code in on a form, and the combo is on a sub-form, then the
format is:

me.TheSubFormContorl.Form.ListBox_lbx.Value = null

So, in your case:

me.sunform_frm.Form.ListBox_lbx.Value = null
 
Thanks Al. I had to also add
me.sunform_frm.Form.ListBox_lbx.Value.RowSource = SQ
me.sunform_frm.Form.ListBox_lbx.Value.Requer
me.sunform_frm.Form.ListBox_lbx.Value = nul
Ric
----- Albert D. Kallal wrote: ----

Assuming your code in on a form, and the combo is on a sub-form, then th
format is

me.TheSubFormContorl.Form.ListBox_lbx.Value = nul

So, in your case

me.sunform_frm.Form.ListBox_lbx.Value = nul


-
Albert D. Kallal (MVP
Edmonton, Alberta Canad
(e-mail address removed)
http://www.attcanada.net/~kallal.ms
 
Back
Top