Click here for great value web hosting.







Search for




The Database Toolbar

If you have a spreadsheet containing a list of data you can use the database toolbar to help you import selected data to create a table.  To display the database toolbar, click on View -> Toolbars -> Database.

To create a table by importing data, click on the Insert Database icon and a wizard will help you with the rest of the process.  

Click on the Get Data button and you will be able to browse for your spreadsheet or other data source, make sure the Files of type box is set to the type of data source you are looking for or you will not see your file.  Click on the file to select it and then click the Open button.

Wait a moment for Word to connect to your data source and, if you are importing from a spreadsheet, you will see a window giving you the opportunity to import from the whole spreadsheet or only a named range.

Click OK and you will now be returned to the wizard and can use a query to only import the data you wish to view.

Click on the Query Options button and you will be able to select the data and fields you want to include in your table, we are selecting rows where goals were scored by 'Henry' or 'Nistelrooy'.

If you want your resulting table to be sorted in a particular order you can click on the Sort Records tab at the top of the Query Options window.

If you only want to display certain columns you can click on the Select Fields tab to choose which fields you want.

There is a tick box on this window to let you choose whether the field names are shown as column headings or not.

We now have all the information Word needs to make our table, click OK and you will be returned to the wizard, click the Insert Data button to create your table.

If you tick the box to Insert data as field, Word will create a database field which you can update if you data source changes to refresh your table from it.  If this box is not ticked, Word will create a simple table that will show a 'snapshot' of your data source at the time the table was created.  Here is our table:

and here is the database field behind the table (press ALT + F9 to display field codes).

{DATABASE \d “C:\Document and Settings\Allabout\My Documents\Excel\goals.xls” \c “Entire Spreadsheet” \s “SELECT Date, Player, Goals FROM C:\Documents and Settings\Allabout\My Documents\Excel\goals.xls WHERE ((Player = ‘Henry’)) OR ((Player = ‘Nistelrooy’)) ORDER BY Player, Date” \h}

If you want to format a table produced by a database field then you should click the Table Autoformat button at the second step of the wizard, Word will then add special formatting codes to the database field so that it is always formatted in the same way.

You can combine database fields with mail merge to insert a table of related data for each record, this can be done by entering the relevant mail merge field code, e.g. {MERGEFIELD Player} instead of the values in the SELECT part of the database field.

Click here to return to the Excel index.