A lookup column allows options to be chosen from a drop-down list to be chosen rather than by entering the data manually. The data that is stored in this drop-down list is saved within the overall database within its own table. So, before creating a lookup column, create the table that will store the contents of the drop down list.
This table can be created using the Access table wizard. Normally, it would only have two columns
- Double Click create table by using wizard
- Select a table form close to the one required and then select individual fields in order to customise to the task required
- When fields have been selected and renamed (if needed) click Next
- Change the name of the table to an appropriate vale. Click Next.
- Do not create any relationships at this stage, just click Next.
- Click Next to enter directly into table and click Finish
The lookup column now needs to be inserted in the main table
- Open the main table and click on the header of the column before which the lookup column design is to be inserted. Click on Insert on the task bar and click on Lookup Column.
- Leave the default of lookup column to look up values and click Next.
- Choose the table from which the column is to draw its data. Click Next
- Select fields to be displayed during lookup and click Next
- The width of the column can then be adjusted. Click Next
- Give the field a label and click Finish
A message may appear about an unsupported property, just click OK.
Having updated the main table it is necessary to reflect these changes in the Excel workbook used for analysis.
- Export the data from the created table used by the lookup column in the main table.
- Create a new worksheet in the Excel workbook and copy the exported data into it.
- In both the worksheet for the exported main table data and the Merged worksheets insert a column in the same place as in the main table. That is the inserted column should appear before the same column in both worksheets as in the Access table. This will also cause Excel to automatically change the =LOOKUP statements in the merged worksheet to point to the shifted columns.
- Export the data from the main table. Delete the entries in the existing main table worksheet (ctrl-a to select all data and then delete). Copy the exported records into the main table worksheet.
- In the merged worksheet add an appropriate =LOOKUP statement.
- Refresh the PivotTable