UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
 
   Reply to this topicStart new topic
> The expression you entered has an invalid reference to the Parent property    
 
   
Freezerbird
post May 10 2009, 04:21 AM
Post#1



Posts: 6
Joined: 10-May 09



I have a form frmProducts, which contains two subforms, frmComparators and frmSales. When I click on a record in frmComparators I would like frmSales to refresh with the data that is relevant to that record.
I'm doing this as a work-around because I can't embed frmSales in frmComparators, due to the fact that frmComparators is a continuous form).
I have master/child linked frmSales to frmComparators and added the following code to the OnCurrent event of frmComparators:
Me.Parent.frmSales.Form.Requery
I keep getting the following error every time I click on frmComparators:
"run time error 2452 - the expression you entered has an invalid reference to the Parent property".
I've played about with the syntax of the code, but I can't get it to work. Can someone tell me what I'm doing wrong please?
Go to the top of the page
 
ChrisO
post May 10 2009, 04:35 AM
Post#2


Remembered
Posts: 3,905
Joined: 24-February 03
From: Brisbane, Australia


Welcome to Utter Access.
e.Parent.frmSales.Form.Requery
Basically would refer to a control frmSales on the Parent Form and the Form within that Control.
Try simply…
Me.Parent.Requery
Untested airware.
Regards,
Chris.
Go to the top of the page
 
ansentry
post May 10 2009, 04:40 AM
Post#3



Posts: 205
Joined: 1-October 02
From: Melbourne, Australia


If I understand your situation then you have;
frmProducts as your Main form
You have frmComparators as you subform
and
frmSales as a subform of frmComparators
if I am correct then have a look at my sample attached. It may be of help to you.
Attached File(s)
Attached File  2SubForms.zip ( 35.8K )Number of downloads: 45
 
Go to the top of the page
 
ansentry
post May 10 2009, 04:44 AM
Post#4



Posts: 205
Joined: 1-October 02
From: Melbourne, Australia


Also have a look at the attached document.
Attached File(s)
Attached File  This shows 1st and 2nd subform link.zip ( 32.96K )Number of downloads: 49
 
Go to the top of the page
 
Freezerbird
post May 10 2009, 05:22 AM
Post#5



Posts: 6
Joined: 10-May 09



Ah, I see! Cheers John, you're a star. That's exactly what I want to do. I'll get the hang of this lark sooner or later!
Thanks to Chris too - that kind of worked but for some reason it seemed to requery over and over again, and when I changed the record in the main form the requery set it back to the first record anyway. Not to worry, John's suggestion works for me.
Dan
Go to the top of the page
 


Custom Search
RSSSearch   Top   Lo-Fi    14th August 2018 - 02:31 PM