Expression Builder is your friend. (How to resolve references to controls) (1 Viewer)

Status
Not open for further replies.

Banana

split with a cherry atop.
Local time
Today, 01:36
Joined
Sep 1, 2005
Messages
6,318
There are several links out there that shows how to figure out the references to controls. However, instead of typing and guesisng, Microsoft has provided a easy way to grab the reference using Expression Builder. This can be used within Form Design View or Query Builder.

To open Expression Builder in Form Design View:

Ciick the ellipse button on right side of the properties windows for the appropriate property (in most cases you may use Control Source, Default Value and maybe on rare occasions, Events)


To open the same builder from Query Builder, right-click on the Criteria row for the column where you want to reference the control:


This will then bring up the Expression Builder:


If you opened this from the Form Design, it auto select the form in question as noted above. Likewise, the query will be also there in first row if opened from the Query Editor.

If you want to reference another form (or a subform), you need to navigate through the Loaded Forms:


Note: Don't bother with "All Forms" as you may get an error in event if they are not opened. If it's not in the Loaded Forms list, then you need to rethink the design and verify that the form will be open at the time the expression is called.

You then can select controls from this list:


Alternatively, you can select directly from form's recordset, which IMHO, is a bit safer than getting it through a control:


Note: If you select <Field List>, you will then need to select one of field on the rightmost pane, unlike selecting the control which is in the middle pane.

You now have the references. You also can add functions, both built-in and your custom functions from the Function folders on the leftmost pane.

HTH.
 
Status
Not open for further replies.

Users who are viewing this thread

Top Bottom