View Full Version : automatically fill fields


helpcharity
11-07-2007, 07:51 AM
hello all, any help greatly appreciated.....

I have two tables in the same Access 2003 database.

Table1 is called "Clients" and has address type fields, e.g. street_name, postcode, etc. It also has a field called CYPAN_area.

Table 2 is called CYPAN_Postcodes and has two fields; postcodes and the CYPAN area that postcode belongs to.

I want to create a function so that when someone enters the postcode in table1, the database searches Table2 and identifies which CYPAN area that postcode belongs to and automatically populates the "CYPAN_area" field in Table 1.


any tips greatly appreciated

Harry

PS I'm only a novice so I don't know anything about VBA etc, but I understand excel type formula

RuralGuy
11-07-2007, 08:52 AM
Since you have the CYPAN_area table is is not necessary to have a field in the Clients table for the area information. You can always include the CYPAN area information by joining the two tables by the postcode field in a query.

helpcharity
11-07-2007, 09:08 AM
.... I'm struggling to corectly design the query:confused:

RuralGuy
11-07-2007, 09:28 AM
Use the query builder and put both tables in the grid and drag and drop the postcode field from the CYPAN_Postcodes table to the Clients table.