How to clear list box values after closing a form or opening

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

Guest

I have a list box that gets it rowsource value from a combo box (with the
after update function and using sql) but once I choose that and close the
form and then open it again the list box still has the rowsource in it. Is
there a way to have the list box not to be populated when I start up the form?

Thanks,

Jeremy
 
Put this in the on load event or on current even

Private Sub Form_Current
Me.MyListBox = Null
End Sub

Chris
 
I tried both (the load event and on current) but neither do anything. It
doesn't clear the rowsource value which stays when the form opens. Is there a
way to just clear the rowsource value or set that to null?

Ex.

Private Sub Form_Current
Me.ReferralList = Null
End Sub



Thanks for the help

Jeremy
 
Is this control on a subform?

Chris
-----Original Message-----
I tried both (the load event and on current) but neither do anything. It
doesn't clear the rowsource value which stays when the form opens. Is there a
way to just clear the rowsource value or set that to null?

Ex.

Private Sub Form_Current
Me.ReferralList = Null
End Sub



Thanks for the help

Jeremy


.
 
No it is just a list box on a form. But I think I fixed it i just coded it in
the On Close event as.

Private Sub Form_Close()
'Clears the rowsource on the Coordinators Main Form

ReferralList.RowSource = acLBEnd

End Sub

Thanks tho for the help

Jeremy
 
Back
Top