G
Guest
I have a Main form with two subforms Sub1 and Sub2.
I want to set the RecordSource of Sub2 from the OnGotfocus event on Control1
on Sub1.
My code is:
Dim intCtrl as integer
Dim strSQL as string
intCtrl = Me.Control1
strSQL = "Select * from MyTable where Id = " & strSQL
Forms!Main!Form!Sub2.RecordSource = strSQL
Forms!Main!Form!Sub2.RecordSource.ReQuery
When Control1 gets the focus I get an error Runtime error 2465 Access can't
find the field 'Form' referred in your expression.
Have tried many permutations but no luck.
Grateful for help.
I want to set the RecordSource of Sub2 from the OnGotfocus event on Control1
on Sub1.
My code is:
Dim intCtrl as integer
Dim strSQL as string
intCtrl = Me.Control1
strSQL = "Select * from MyTable where Id = " & strSQL
Forms!Main!Form!Sub2.RecordSource = strSQL
Forms!Main!Form!Sub2.RecordSource.ReQuery
When Control1 gets the focus I get an error Runtime error 2465 Access can't
find the field 'Form' referred in your expression.
Have tried many permutations but no luck.
Grateful for help.