Re: Multiple Fields in record
- From: "tina" <nospam@xxxxxxxxxxx>
- Date: Sun, 17 May 2009 15:55:40 GMT
it doesn't matter whether an invoice has 3 line items, or 300, or 1. *each
line item will be an individual record in tblInvoiceDetails.* and you don't
store the total invoice amount anywhere. you calculate it at runtime,
anywhere you want to see it, by adding all the line item amounts for an
invoice to get the total.
as Philip said, now is when you want to learn how to structure your tables
and relationships correctly, or you'll spend 10 times as long, down the
line, going back and fixing them. recommend you read up/more on relational
design principles (normalization) so you'll understand better one-to-one,
one-to-many, and many-to-many relationships, and how to support them in
Access. for more information, see
http://www.accessmvp.com/JConrad/accessjunkie/resources.html#DatabaseDesign101
hth
"acss" <joekru98@xxxxxxxxxxx> wrote in message
news:452C5DAD-4012-4785-85A2-71810BDAABC1@xxxxxxxxxxxxxxxx
I have two tables, one for Invoices which contain fields such as InvID-PK,the
Inv description, date, Reference. Then i have an Invoice Details table,
DetailId-PK, InvID-FK, Detail Description, InvAmt. Not all invoices have 3
line items that add up to the total amount so while some records will have
detail amounts others will be blank and only a totals amount would be in
InvAmt. Should i have a named field for each line item that will lead upto
the total? Also should i have an InvAmt in the Invoice Table andInvDetails
table as well?be to
"Philip Herlihy" wrote:
acss wrote:
Begining stages of design in DB so i want to be sure on steps. It will
(expensestrack expenses on invoices and each invoice has several line items
awith dollar amounts) that add up to the final total. Do I need to have
box onfield in my table for each line item so it an be populated by a combo
a form?
You're asking the right questions at the right time. Get your tables
right and everything else falls into place - otherwise it quickly
becomes an impossible tangle.
This is a familiar pattern - "one-to-many". That's normally represented
by two tables, one with a field to carry references to records in the
other - a "foreign key".
If you structure your data this way, and then use the Form Builder
wizard, Access will (if you look out for the options) create you forms
which will get you working with your data right away.
You'd typically use a combo box when you want to provide the user with a
convenient way of choosing one from multiple stable options - an easy
example would be "Male / Female" in one situation, or a list of charge
rates in another. In the first case, the options would be stored among
the "Properties" of the combo box control. In the second case, the
charge rates would probably be stored in a dedicated table. although
Access allows "lookup" options in tables, it's better keep your tables
as pure and simple as possible.
You might like to look at a couple of my favourite web references on
table design:
http://www.lynda.com/home/Player.aspx?lpk4=31001
http://tinyurl.com/ms-table-design-tutorial
You might also like to have a look at the samples which come with Access
(although they can be omitted at install time). You can create a
database from a template (File, New, and look for the template options)
or study the Northwind sample database (under Help, Samples - oddly
enough). They can seem a bit daunting for a beginner, but you'd be
welcome to ask questions here.
Helps to know which version you're using. The fundamentals are the same
but the "dashboard" is different, especially in Access 2007.
HTH
Phil, London
.
- References:
- Multiple Fields in record
- From: acss
- Re: Multiple Fields in record
- From: Philip Herlihy
- Re: Multiple Fields in record
- From: acss
- Multiple Fields in record
- Prev by Date: RE: How to display and store current Week Ending Date (Saturday's)
- Next by Date: Re: Multiple Fields in record
- Previous by thread: Re: Multiple Fields in record
- Next by thread: Re: Multiple Fields in record
- Index(es):
Relevant Pages
|