Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Clear List Box 1

Status
Not open for further replies.

MeldrethMan

Technical User
Feb 3, 2012
69
GB

I'm setting up a selector form for people taking part in a series of activities. This will draw data from a table including Activity, Date, Person and ActivityType (Regular or One-Off).

The selector form contains and an option group a combo and a list box.

The option group sets the rowsource of the Activity combo either to just Regular or One-off types. The combo has Activity as bound value. Its AfterUpdate event populates the list box with all dates on which that activity has taken place so a particular one can be chosen and a list then created of all the people on it.

All this works fine. The problem is that I'd like to clear the list box if switching between Regular and One-off in the option group. It its AfterUpdate I can clear the Activity combo by just setting Me.cboActivity = Null.

How can I clear the list box?
 
Soeething like this ?
Me![list box name].RowSource = ""

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 

Did try that and while it clears the list box it then prevents it being repopulated after choosing an Activity.

The list box source uses Select Distinct dates from the original table, with the combo's Activity as criterion. I've put in a Recalc and Requery to no effect.

 
And this ?
Me!cboActivity = Null.
Me![list box name].RowSource = Me![list box name].RowSource

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top