Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Application-defined or object-defined error

Status
Not open for further replies.

dolfin13

Programmer
Jun 29, 2005
22
US
I get this error when invoking the click event from the subform.

This is the code in the click event.

Me.txtActivityID = Forms![Fmast_ContactTabs].Form.CSP_T_TeamActivityLog_ID
Forms![Fmast_ContactTabs].Form.subDetails.LinkChildFields = "txtActivityID"
Forms![Fmast_ContactTabs].Form.subDetails.LinkMasterFields = "CSP_T_TeamActivityLog.ID"

Any idea what's causing this?
 
I have found the solution to this problem, I should be more careful! Sorry for the waste of space.
 
How are ya dolfin13 . . . . .

A definite [blue]referencing problem[/blue] here. It appears you want to access [purple]master/child link properties[/purple] for a subform, from another subform . . . Is this correct!

If so . . . try:
Code:
[blue]Forms![purple][b]MainFormName[/b][/purple]![purple][b]subFormName[/b][/purple].LinkChildFields = "txtActivityID"
Forms![purple][b]MainFormName[/b][/purple]![purple][b]subFormName[/b][/purple].LinkMasterFields = "CSP_T_TeamActivityLog.ID"[/blue]
Be aware: [blue]a subform is a control like any other[/blue] . . . so it matters if you reference it as a control or a form! (the reason for [blue].Form[/blue] to reference as a form).

The [blue]Master/Child Link properties[/blue] are available on the control . . . not the form!

Calvin.gif
See Ya! . . . . . .
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top