me.parent.parent.name problem run time 2452

thescottsman

Registered User.
Local time
Today, 19:50
Joined
Sep 18, 2014
Messages
42
Hi All

I have a form where I want to return the grandparents form name. The code is as below:

If Me.Parent.Parent.Name = "frm_Operations" Then
'Operations form
Forms!frm_Operations!txtoperationscontract = Me.Contract
ElseIf Me.Parent.Parent.Name = "frm_Engineering" Then
'Form is engineering
Forms!frm_Engineering!txtengineeringsearch = Me.Contract
End If

2452: The expression you entered has an invalid reference to the panel property

It works form the operations form but not form the engineering

Can anyone help?
 
So what is the problem? Access is telling you that there is no such thing as .parent.parent for the form in question - we cannot just pass a magic wand and make it be there.
 
maybe it is failing at this line

Forms!frm_Engineering!txtengineeringsearch = Me.Contract


which line exactly throws the error?
 

Users who are viewing this thread

Back
Top Bottom