changing recordsource continuous subform in vba

I

icccapital

I have a subform that is setup to be continuous and has the recordsource set.
When the form is opened it runs fine and shows all the records from the
recordsource query. I then have a check box that if chosen changes the
recordsource to a less filtered version adding, which just removes the where
clause. If the user clicks it again the recordsource is returned to its
previous state.

I do all of this with me.recordsource = "SELECT....", which is all
controlled within the subform.

What happens is when I change the recordsource as above, only one record is
returned in the subform, and if I change it back by clicking the checkbox it
still only shows that one record. Seeing as the second select query is more
inclusive it should be more records not less and certainly not one.

I have attempted, me.requery, me.refresh and me.recalc.

Anybody have any other thoughts? Thank you.
 
M

Maurice

Sometimes it helps to clear the recordsource first like me.recordsource=""
and then fill it again with the select statement you are after. Give it a try
and see if that helps.
 
I

icccapital

Thanks for the thoughts Maurice. Unfortunately that didn't work. I can
check the recordsource and it is correct, it just seems to return the one
record, and I see it requerying at the bottom (running query). Very odd.

Thanks to anyone else who has an idea
 

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