cicoa
IS-IT--Management
- Aug 21, 2001
- 8
I have been banging my brain out all week on this. I guess I haven’t had any access databases with this type of relationships before. Most of mine have just been two linked tables.
What I am trying to accomplish is setting up a database for a transportation voucher program, so we can eliminate the Excel spreadsheet the user is using.
So I need three basic tables: client info, orders, vouchers. They are called NEWFREEMAST, NEWFREEDET, NEWFREEVOUCH
Each client can have multiple orders, and each order can have multiple vouchers. So I assume there is a one to many relationship between NEWFREEMAST and NEWFREEDET (details being the many side)
And a many to many relationship between NEWFREEDET and NEWFREEVOUCH
So I set up a junction table.
Here is the design:
Client table NEWFREEMAST:
CLIID autonumber for the primary key.
Lastname
Firstname
M
Address1
Address2
City
Etc
Order details table NEWFREEDET:
DETID Autonumber as primary key
Order date
CLIID – to link to client table , number field
Number vouchers requested
Payment Amount, etc
Voucher table NEWFREEVOUCH
VOUCHID autonumber as primary key
Voucher #
DETID – to link to order table, number field
CLIID – to link to both tables. When I didn’'t include this field I got errors on
Date Voucher Redeemed, etc.
JUNCTION TABLE
DETID – Primary Key
VOUCHID – Primary Key
CLIID – Primary Key
Table Relationships:
Join lines go from:
newfreemast cliid to newfreedet cliid
newfreedet detid to junction detid
newfreevouch vouchid to junction vouchid
My problem seems to be the relationship between newfreedet and newfreevouch
I can enter the data on all three forms (I designed it using tabbed forms), but the voucher table does not link up to the orders table, so I could never run a report to get what vouchers are connected to what orders.
I have tried multiple setups using using multiple primary indexes for orders and vouchers, but this is my latest design because I at least don’t get any errors.
Can someone tell me where my design flaw is?
What I am trying to accomplish is setting up a database for a transportation voucher program, so we can eliminate the Excel spreadsheet the user is using.
So I need three basic tables: client info, orders, vouchers. They are called NEWFREEMAST, NEWFREEDET, NEWFREEVOUCH
Each client can have multiple orders, and each order can have multiple vouchers. So I assume there is a one to many relationship between NEWFREEMAST and NEWFREEDET (details being the many side)
And a many to many relationship between NEWFREEDET and NEWFREEVOUCH
So I set up a junction table.
Here is the design:
Client table NEWFREEMAST:
CLIID autonumber for the primary key.
Lastname
Firstname
M
Address1
Address2
City
Etc
Order details table NEWFREEDET:
DETID Autonumber as primary key
Order date
CLIID – to link to client table , number field
Number vouchers requested
Payment Amount, etc
Voucher table NEWFREEVOUCH
VOUCHID autonumber as primary key
Voucher #
DETID – to link to order table, number field
CLIID – to link to both tables. When I didn’'t include this field I got errors on
Date Voucher Redeemed, etc.
JUNCTION TABLE
DETID – Primary Key
VOUCHID – Primary Key
CLIID – Primary Key
Table Relationships:
Join lines go from:
newfreemast cliid to newfreedet cliid
newfreedet detid to junction detid
newfreevouch vouchid to junction vouchid
My problem seems to be the relationship between newfreedet and newfreevouch
I can enter the data on all three forms (I designed it using tabbed forms), but the voucher table does not link up to the orders table, so I could never run a report to get what vouchers are connected to what orders.
I have tried multiple setups using using multiple primary indexes for orders and vouchers, but this is my latest design because I at least don’t get any errors.
Can someone tell me where my design flaw is?