Referencing controls on/in Navigation Controls

liamfitz

Registered User.
Local time
Today, 13:43
Joined
May 17, 2012
Messages
240
I'm having trouble referencing acontrol. Any advice much appreciated. Here is what my VBA reference would be, if I just went down through the 'hierarchy' using full-stops to get to the form with the value/control I want...
With frmNavigationLeft.frmNavigationTop.frmClients.sfrmReferrals.Variable/ControlName

i.e I have a Main Form ( frmClients ) holding a Subform ( sfrmReferrals ), these are both on a Navigation Form ( frmNavigationTop ), which itself is a 'sub' form of another Navigation Form ( frmNavigationLeft ). Please help if you can.:banghead:
 
thanks boblarson, but I've read all those. I'm not explaining it well maybe. Imagine I don't have any Navigation Controls 'holding' my Main Form and subform. I can retrieve values from the main form, no problem, but it's a field value from the subform ( subform in the old sense of the word before Navigation Controls and Navigation Subforms syntax, if you prefer - please don't confuse the two ) Your links for Main, sub1, sub2 syntax don't work in these scenarios. Please help. It keeps saying 'Object doesn't support this property or method' for ....
Forms!frmNavigationLeft!NavigationSubform!NavigationSubform!sfrmReferrals.Referral_ID

I know it's the last TWO references i.e. sfrmReferrals.Referral_ID that are the problem. Thanks.
 
Without seeing the database it might be hard to get it but first off this syntax would be wrong:

Forms!frmNavigationLeft!NavigationSubform!Navigati onSubform!sfrmReferrals.Referral_ID


It SHOULD be this:
Forms!frmNavigationLeft!NavigationSubform.FORM!NavigationSubform!sfrmReferrals.FORM!Referral_ID

IF I am understanding what you have. You may need to post a sample with fake data but see if that works.
 
Once again Bob, you've been a 'godsend'. Works perfectly. The logic seems to be, that the 'hierarchical' command treats a subform and Main form in the same way for ordering. Thanks.
 

Users who are viewing this thread

Back
Top Bottom