also, in what form or control event are you running the code? and in which
form module?
you didn't answer the above questions. also, please copy your entire
procedure from the VBA Editor window, and paste it into your reply. and
which versions of Access and Windows are you using?
tina thanks very much!
The error message is ...."RunTime error 2455, You entered an expresssion
that has
an invalid reference to the property Form/Report."
My forms are constructed like this....
A Parent form named "List" (Level 1), a subform in "List" Named "List
Subform" (Level 2) and finally a subform in "List Subform" named "List
Subform Holdings" (Level 3)
The control name of "List Subform" in "List" is "list_subform"
The control name of "List Subform Holdings" is "list_subform_subform"
I build this format because i want to make a datasheet that show the
relationship between two tables.
I use VBA to set the recordsource of "List"'s Subform(Level2) in "List"
(Level1) by the following
Me.list_subform.Form.RecordSource = sql
The above line is okay and it run properly
Then, i use VBA to set the recordesource of "List Subform"'s Subform
(Level3) in "List Subform"(Level2) by the following
[Forms]!
- ![list_subform].Form![list_subform_subform].Form.RecordSource
= sql_subform
But it fails......
Today, the code can run without error for sometimes, but later the error
2455 pop-up again ;_;......
"tina" ??:
what *text* description do you see when the error message comes up?
also, in what form or control event are you running the code? and in
which
form module?
sorry, the run-time error is 2455
:
thx tina,
I have tried both of your method.
But both of them fail with the sum error - run-time error 2245
i am sure that list_result_subform and subform_control are both
controls
name only, not the form names.