On Mon, 28 May 2007 11:17:30 GMT, "StevePlym" <(E-Mail Removed)> wrote:
>I am creating a database for my small consultancy - around 30 clients.
>
>In addition to the table containing names, addresses, etc. I want a table to
>record invoices raised - dates, amounts, date paid, etc.
>
>I'm assuming i make the Client ID field the primary key in the contacts
>table. How do I use this to auto-complete the client firstname and surname
>into the invoice table? In other words - I want to just be able to enter the
>client ID into the invoice table and have it enter the firstname and surname
>automatically.
You should ONLY store the ClientID in your Invoice table, and NOT the FirstName, LastName, etc ... otherwise, what
happens when you realize you've spelled the client's name incorrectly? You'd then have to go back through the tables and
correct all misspellings ...
Access/Jet is a relational database system; tables should store information that's relevant to itself; for example, an
Invoice table would perhaps store the InvoiceDate, InvoiceAmount, ShippingMethod, Terms etc etc ... those are
"properties" of an Invoice, and would rightly belong in that table, but the client's FirstName and LastName are NOT
properties of the invoice ... they are relevant to the invoice (otherwise how would you know which client the invoice
"belonged" to), but they don't "describe" the invoice, they instead "describe" the Customer, so they should be stored in
the Customer/Client table.
So you'd maintain your setup as you have it - store the ClientID in the Invoice table when a new invoice in generated.
If you need to see the information as a whole (i.e. both Invoice and Client info) then build a query which returns that
information.
Scott McDaniel
scott@takemeout_infotrakker.com
www.infotrakker.com