F
Froefel
Hi group,
I'm experiencing the weirdest behavior on one of my forms.
The main form (Form View) has a subform (Datasheet View), but the
subform is not dependent on the main form, even though the main form
and the subform both have a field LocationID.
In the main form's design I made sure that the LinkChildFields and
LinkMasterFields properties are empty.
The expected behavior is that when clicking a record in the subform,
certain details are displayed in the main form.
I achieve this simply by dynamically setting the recordsource of the
main form in the subform's Form_Current event.
On the main form's Form_Load I am dynamically setting the recordsource
of the subform based on a radio-button in the main form, using Me.
[Subform].Form.Recordsource = strSQL
However, mysteriously, this statement automatically causes the
LinkChildFields and LinkMasterFields properties on the main form to be
set to LocationID. The result is that instead of displaying the entire
results of the SQL statament, only one record is displayed
(corresponding to the LocationID).
So my question is: why do the LinkChildFields and LinkMasterFields
properties get filled in automatically and is there a way to prevent
this from happening?
-- Hans
I'm experiencing the weirdest behavior on one of my forms.
The main form (Form View) has a subform (Datasheet View), but the
subform is not dependent on the main form, even though the main form
and the subform both have a field LocationID.
In the main form's design I made sure that the LinkChildFields and
LinkMasterFields properties are empty.
The expected behavior is that when clicking a record in the subform,
certain details are displayed in the main form.
I achieve this simply by dynamically setting the recordsource of the
main form in the subform's Form_Current event.
On the main form's Form_Load I am dynamically setting the recordsource
of the subform based on a radio-button in the main form, using Me.
[Subform].Form.Recordsource = strSQL
However, mysteriously, this statement automatically causes the
LinkChildFields and LinkMasterFields properties on the main form to be
set to LocationID. The result is that instead of displaying the entire
results of the SQL statament, only one record is displayed
(corresponding to the LocationID).
So my question is: why do the LinkChildFields and LinkMasterFields
properties get filled in automatically and is there a way to prevent
this from happening?
-- Hans