Access 2003
Hi All,
I have 2 unbound visible subforms - "a" = datasheet view "b" = single view on a main form(single view).
On the "b" subform I need to change the recordsource when a record is viewed in "a" subform.
If I put the following code on one of the fields in subform "a":
and am in subform "a" and I view the record on the above field, then subform "b" updates as it should, no problem.
However, there are many fields in subform "a", so a I would like the recordsource to be set when any record is viewed, not just when that particular field is viewed.
So I put the above code in the oncurrent even of subform "a", but subform "b" does not update according to the recordset, nothing happens, but you can see that subform "a" is calculating, but subform "b" does not change.
I have also tried refresh and requery on form "b", but no joy.
Any guidance will be appreciated.
Michael
Hi All,
I have 2 unbound visible subforms - "a" = datasheet view "b" = single view on a main form(single view).
On the "b" subform I need to change the recordsource when a record is viewed in "a" subform.
If I put the following code on one of the fields in subform "a":
Code:
Private Sub a_field_GotFocus()
Dim MVCode As String
Dim mvSQL As String
MVCode = MVL_CODE
mvSQL = "select field1,field2 from table1 where mvl_code = '" & MVCode & "'"
Form_b.RecordSource = mvSQL
and am in subform "a" and I view the record on the above field, then subform "b" updates as it should, no problem.
However, there are many fields in subform "a", so a I would like the recordsource to be set when any record is viewed, not just when that particular field is viewed.
So I put the above code in the oncurrent even of subform "a", but subform "b" does not update according to the recordset, nothing happens, but you can see that subform "a" is calculating, but subform "b" does not change.
I have also tried refresh and requery on form "b", but no joy.
Any guidance will be appreciated.
Michael