D
DanJ
I have a Main form with a subform which I want to set the Master/Child
property for in code. In the Main forms Open event I have the following:
Me.Jail_Record_Act_Log.LinkMasterFields = "Jail_ID"
Me.Jail_Record_Act_Log.LinkChildFields = "Jail_ID"
Jail_ID is a long integer field and the control is the same name as the
field. Jail_ID is Primary Key for the recordsource of the main form and a
foreign key for the recordsource of the subform.
Jail_Record_Act_Log is the name of the subform control which holds the
subform of the same name.
When I open the main form I get the following error:
Run-time error '2101':
The setting you entered isn't valid for this property.
I experimented by manually adding the Jail_ID link in Design view and it
works fine if I save the form with the link already entered. But I want to
be able to change the link in code later.
I have also tried changing all the names so that the field name is different
than the control name and the subform name is different than the subform
control name.
Any ideas what is wrong?
property for in code. In the Main forms Open event I have the following:
Me.Jail_Record_Act_Log.LinkMasterFields = "Jail_ID"
Me.Jail_Record_Act_Log.LinkChildFields = "Jail_ID"
Jail_ID is a long integer field and the control is the same name as the
field. Jail_ID is Primary Key for the recordsource of the main form and a
foreign key for the recordsource of the subform.
Jail_Record_Act_Log is the name of the subform control which holds the
subform of the same name.
When I open the main form I get the following error:
Run-time error '2101':
The setting you entered isn't valid for this property.
I experimented by manually adding the Jail_ID link in Design view and it
works fine if I save the form with the link already entered. But I want to
be able to change the link in code later.
I have also tried changing all the names so that the field name is different
than the control name and the subform name is different than the subform
control name.
Any ideas what is wrong?