Hello,
A subform has 4 fields, State, Location ID, Total and District.
For the first 3 fields ( State, LocationID, Total ) the data is obtained using a query 1. This is set up in the design mode
For the last field, District, data needs to be obtained by passing locationID to
Table 2.
E.g...