At the moment I am merely imputting city names in one column and the distances in a second column and assigning an ID to each row.
Please forgive me if I fail to pitch my reply at the most helpful level. You mention 40 pages of data most of which I guess you have yet to input. Few things are more depressing than typing all that data into an OpenOffice Base table, and then losing the lot which is an all too common experience before you have gained experience with the idiosyncrasies of Base which is the least mature element of the OpenOffice applications.
When I started I found it much safer to enter database data initially into an OpenOffice Calc spreadsheet. Admittedly I was more accustomed to using spreadsheets, but a Calc spreadsheet can be regularly saved as you enter the data and easily backed up.
The great strength of OpenOffice is that its constituent parts work well together. Provided no cells are left empty in your three columns of the spreadsheet, it will be easy to access this data from Base: you can link/register the spreadsheet as the data source for Base forms, queries or reports. There is one proviso: you can read but cannot change the spreadsheet data from within Base. Until you are more familiar with Base that is no bad thing: it keeps the data safe. You can still change or add to the data, but you have to do it in the spreadsheet itself but only when the linked Base is not open and the changes will not be reflected in Base until the Calc spreadsheet has been closed.
If you have already entered a lot of data into a Base table, do not worry. It is easy to copy that data from the Base table into Calc. Open a new Calc file and press f4. If the database file has been registered it will appear in the so-called
beamer above the empty sheet. In the left hand box of the beamer select the Base file name and the table name from the list of tables: a copy of the Base table will appear in the right hand box.
Click on the top left gray cell and while all the data is selected drag that gray cell down into the A1 cell of the spreadsheet. Alternately while all the data is selected in the right hand box, right click on the top left gray cell, select copy, move the cursor to the A1 cell and paste. Once the sheet is filled, press f4 to close the beamer and save the Calc file.
In due course enter all 40 pages of data into the spreadsheet. As all the data is quickly visible in the spreadsheet it is easy to spot and correct errors. By typing Ctrl+f you can enter part or all of a City Name and find the mileage quickly. If you sort the data in the spreadsheet by the the City Names you can even search visually. This is a primitive but effective way of meeting your aim.
To link the spreadsheet to Base. You should first check that all the data in the spreadsheet (other than the titles in the top row) are correctly formatted according to the respective columns: text for City Names and Numeric for distances. Open a new Base file. In the opening screen select the lowest radio button against "Connect to an existing database file". In the drop down box just below select "Spreadsheet" and click Next. In the next screen browse to and select your Calc file containing the data and click Next. In the next screen leave the radio button "Yes, register the database for me" selected and "Open the database for editing" checked. Click Finish and save the file with a suitable name. Hopefully the table in the new Base file will match the spreadsheet and will reflect changes or additions after they have been made to the spreadsheet that is subsequently saved.
I suggest that before attempting to create a form in Base to display distance whenever a City Name is typed, you download "Getting Started with Base" to be found at
http://wiki.services.openoffice.org/w/i ... thBase.pdf
Again my apologies if this long post tells you nothing that you did not know already and nothing new that you wanted to know. Please come back and I will try to be more helpful when explaining how to set up a
form in Base to meet you specific requirement.