I'm programmatically setting subform sourceobject and sometimes the subform recordsource for ~75 subforms.
Case 1 - When only I set the subform's sourceobject with the recordsource preset, everything works fine.
Relevant code is: Me!sfrmDetail.SourceObject=sfrmName
Case 2 - When I set the subform and then it's recordsource programmatically I see no records although records exist. New records are added corrrectly, but when I switch suforms and come back to the original subform all records are missing in the subform, although they are in the underlying table.
In this latter case, I set the subform sourceobject, then the subform recordsource. Debugging the subform shows the correct record source, but no records are displayed.
Relevant code is: Me!sfrmDetail.SourceObject=sfrmName
Me!sfrmDetail.form.RecordSource="SELECT * FROM tbP29" & me!cboSCat-17 & " WHERE [FileID]=" & Forms!frmDetail!FileID
This appeared to be a requery problem, but requerying the subform doesn't give me anything.
Me!sfrmDetail!Refreshing, Repainting and Requery do not help.
Using the real sfrmName does not help.
I'm obviously missing something simple here.
Any help would be appreciated.
Case 1 - When only I set the subform's sourceobject with the recordsource preset, everything works fine.
Relevant code is: Me!sfrmDetail.SourceObject=sfrmName
Case 2 - When I set the subform and then it's recordsource programmatically I see no records although records exist. New records are added corrrectly, but when I switch suforms and come back to the original subform all records are missing in the subform, although they are in the underlying table.
In this latter case, I set the subform sourceobject, then the subform recordsource. Debugging the subform shows the correct record source, but no records are displayed.
Relevant code is: Me!sfrmDetail.SourceObject=sfrmName
Me!sfrmDetail.form.RecordSource="SELECT * FROM tbP29" & me!cboSCat-17 & " WHERE [FileID]=" & Forms!frmDetail!FileID
This appeared to be a requery problem, but requerying the subform doesn't give me anything.
Me!sfrmDetail!Refreshing, Repainting and Requery do not help.
Using the real sfrmName does not help.
I'm obviously missing something simple here.
Any help would be appreciated.