|
Bind a text field with a form |
|
Displaying a filed from a query that somehow relates to a form which is currently opened is very easy with MS Access. Here we briefly discribe how to do that.
- First create a query which will contain a field you would like to display on the form (let's say the query will display a list of properties with the count of tenants as an atrribute).
- Once the query is saved go to a design mode of your form and place a text field on the form.
- Display properties of the text field (not a label!) and go to Data > Control Source.
- There you find a Control Source property. Here we have to tell to Access what field and from what query we want to display there.
- Let's use handy DLookUp formula:
=DLookUp("[Field_Name to be displayed]","Table_Name","[Field_Name from query] = Form![Field_Name from form]")
Example: =DLookUp("[Tenants]","QRY_LIVE_COUNTS","[Property_Name] = Form![Property_Name]")
|