B
Billy Smith
I'm having a problem with a small MS Access 2000
database (.mdb).
I have a main form and on it I have two datasheet subforms
I'll call sf1 and sf2. Sf1 and sf2 are both placed on
the main form at the same level as if they are both
children of the main form. I want to use a value from a
record in sf1 to set the RecordSource, i.e. do a query
on sf2. So in the click event proc on sf1 I try to
reference the RecordSource of sf2 but I get nothing
but error messages. For example:
Me.Parent![sf2].RecordSource = strSQL
produces runtime err 2465: "MS Access can't find field sf2"
which is confusing because sf2 is the name of
a subform and not a field.
What is bothering me is that I've searched far and wide
for the rules on how to do this kind of reference and
I can't find them. I've found and tried many other
suggestions, like all of the following:
Parent![sf2].Form!RecordSource
Me.Parent![sf2].Form!RecordSource
Me.Parent![sf2]!RecordSource
Me.Parent![sf2 control name].Form!RecordSource
Parent.Form![sf2]!RecordSource
Can someone tell me where to find the rules for making
this kind of reference to a sibling subform?
Thanks,
Billy
database (.mdb).
I have a main form and on it I have two datasheet subforms
I'll call sf1 and sf2. Sf1 and sf2 are both placed on
the main form at the same level as if they are both
children of the main form. I want to use a value from a
record in sf1 to set the RecordSource, i.e. do a query
on sf2. So in the click event proc on sf1 I try to
reference the RecordSource of sf2 but I get nothing
but error messages. For example:
Me.Parent![sf2].RecordSource = strSQL
produces runtime err 2465: "MS Access can't find field sf2"
which is confusing because sf2 is the name of
a subform and not a field.
What is bothering me is that I've searched far and wide
for the rules on how to do this kind of reference and
I can't find them. I've found and tried many other
suggestions, like all of the following:
Parent![sf2].Form!RecordSource
Me.Parent![sf2].Form!RecordSource
Me.Parent![sf2]!RecordSource
Me.Parent![sf2 control name].Form!RecordSource
Parent.Form![sf2]!RecordSource
Can someone tell me where to find the rules for making
this kind of reference to a sibling subform?
Thanks,
Billy