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.

  1. 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).
  2. Once the query is saved go to a design mode of your form and place a text field on the form.
  3. Display properties of the text field (not a label!) and go to Data > Control Source.
  4. 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.
  5. 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]")