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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

another subform question

Status
Not open for further replies.

RemyS

Technical User
Jul 3, 2001
100
GB
I have a form, which contains 5 subforms.
The Parent-Child is based on a product code.
Each subform also has a date criteria.

The volumes of data can get pretty large so, to speed the querying up, I decided to split this into a current data (1 weeks worth of data) and an Archive (everything prior to last week).

I was able to switch the Recordsources for each subform depending on a date selected.

I've since altered the main Forms recordsource (to include the previous data as the 5th subform), and the code no longer works.

This is what I was using:
Me.UNPAID_subform.Form.RecordSource = mySQL

but it now returns an error stating I have an expression that has an invalid reference to the property Form/Report?

Could anyone suggest why this is now happening, and what I should do to correct it.


Thanks in advance.
Remy Still new to DB's and enjoying learning day by day
 
Xcuse me for yet again solving my own problem.

I noticed that the error was occuring when the date selected was changed.

This then led me to try requerying the subform before changing it's RecordSource.

Which solved the error.

I'm guessing that it might have something to do with the fact that the subforms' underlying query criteria had been altered, so without requerying it, it would not be recognised.

I still don't understand why this should happen now, as the code worked fine beforehand, but where there's a will there's a way.
[pipe] Remy Still new to DB's and enjoying learning day by day
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top