Reseting a subform to null

PiedPiper70

Registered User.
Local time
Today, 03:05
Joined
Oct 21, 2012
Messages
115
On a form I have 2 list boxes and a subform in a cascading arrangement. When the form is opened the first list box is populated with data from a query. When an item is selected in List Box 1 then entries appear in List Box 2 from another query. When an entry in List Box 2 is selected then entries appear in the Subform from a third query. It's all working fine except for this:- if a new selection is made in List Box 1 then I want all entries in the Subform to be cleared until something is selected in List Box 2, but I can't see how to do it.

I've tried setting the Subform's recordsource to null, to " " and to "" but none of these work properly. They either give an error or leave a single entry in the subform with #Name? in every text box.

It does work if I use a List box instead of a subform but that's not what I want here.

I hope I explained it clearly enough. Can anyone help please?

Thanks
Dave
 
I've tried setting the Subform's recordsource to null, to " " and to "" but none of these work properly. They either give an error or leave a single entry in the subform with #Name? in every text box.
Run the third query with an entry you know allways will return no records, (like an ID=-1).
 
Thanks JHB - it worked !!!
 

Users who are viewing this thread

Back
Top Bottom