Expression Builder pointing to subform field (1 Viewer)

got_access:]

Registered User.
Local time
Today, 10:29
Joined
Jun 15, 2018
Messages
83
Hi All,
I may have asked this question in a different way a while ago.
So I apologize for not remembering the answer.

I'm adding a field to a form which essentially points to another field in that form.
At first I used the expression builder to create the pointer to the source field.
I did this in the expression builder by opening up the form properties and clicking on the field I wanted to use as the source - as displayed by the expression builder.

But access didn't like the syntax call-out for that source field - as created by the expressoin builder. A little manual modification got it to work.

Expression builder syntax (doesn't work):
=Forms![frmOrdersHistorySubform]![Txtfield_Average_Price]

Manually fixed syntax (does work)
=[frmOrdersHistorySubform].[Form]![Txtfield_Average_Price]

I would have thought the best way to build the syntax would be by using the expression builder - but in this case - that was a wrong assumption.

I need to understand the rule used for the syntax in these parent child relationships for form objects.

Thanks in advance!
 

isladogs

MVP / VIP
Local time
Today, 18:29
Joined
Jan 14, 2017
Messages
18,261
OK let's assume you did ask this before.
Rather than expect members to repeat information, try doing a little research first....

Click on your member name then click on find more posts by ….
Search the list and see what you find.

Or use advanced search filtering for suitable keywords and your user name.
Good luck
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Tomorrow, 01:29
Joined
May 7, 2009
Messages
19,246
Forms![ParentFormName]![ChildFormName].Form![controlOnChildForm]

if calling within ParentFormName, you can simple use the ChildFormName:

Me![ChildFormName]![controlOnChildForm]
Me![ChildFormName].Form![controlOnChildForm]
[Form]![ChildFormName]![controlOnChildForm]
[Form]![ChildFormName].Form![controlOnChildForm]
[ChildFormName]![controlOnChildForm]
[ChildFormName].Form![controlOnChildForm]
 

Dreamweaver

Well-known member
Local time
Today, 18:29
Joined
Nov 28, 2005
Messages
2,466
Shouldn't it be forms arnelgp

I.E. Forms!frmDetectIdleTime!WorkingDays
 

got_access:]

Registered User.
Local time
Today, 10:29
Joined
Jun 15, 2018
Messages
83
OK let's assume you did ask this before.
Rather than expect members to repeat information, try doing a little research first....

Click on your member name then click on find more posts by ….
Search the list and see what you find.

Or use advanced search filtering for suitable keywords and your user name.
Good luck

Thanks isladogs - I did search all of my previous posts and didn't see it.
But I can continue to search for those keywords.
 

got_access:]

Registered User.
Local time
Today, 10:29
Joined
Jun 15, 2018
Messages
83
If I understand correctly, [FORMS] represents a collection -while [FORM] represents an object.
 

MajP

You've got your good things, and you've got mine.
Local time
Today, 13:29
Joined
May 21, 2018
Messages
8,605
If I understand correctly, [FORMS] represents a collection -while [FORM] represents an object.
Yep. "Forms" is a collection of all the open forms
Forms!SomeFormName
or Forms("SomeFormName") if using dot notation
Where Form is a property of certain objects and returns the form
Me.SubformControl.Form
returns the form inside the subform control
That makes sense to me. But a form also has a "Form" property.
Me.Form returns the form
This I have never understood why you would need this property. It is like a circular property. The property returns itself. You can actually do this writing as many "form" as you wish.
Code:
MsgBox Me.Form.Form.Form.Form.Somecontrol.Name
Each form just returns a pointer to itself which has a form property. Not sure of the utility.
 

Users who are viewing this thread

Top Bottom