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

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
 
C

Chris Reveille

Put this in the on load event or on current even

Private Sub Form_Current
Me.MyListBox = Null
End Sub

Chris
 
G

Guest

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
 
C

Chris Reveille

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


.
 
G

Guest

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top