T
Tom Bock
In an earlier thread, I raised the questions as to what would be the best
design for a relatively simple relationship such as:
This is the structure:
1. tblFacility
2. tblAccount
3. tblBills
Each facility has 1 or more accounts. Each account has 1 or more bills.
Although the reply below (within &&&) seems very logical and the results in
a query DO GIVE me the proper results, I am really having a hard time to
string the table in forms and subforms.
Currently, I am unable to enter a new record that would create a new
autonumber in each of the 3 tables.
Here's how I would like to have the form structure:
1. Account - Main form
2. Facility and Bills - Sub form.
Here's why I chose this main/sub form structure.
Let's say I have:
- 10 facilities
- 15 accounts (I may have more than 1 account per medical facility)
- 50 bills (I may have more than 1 payment per account and per facility).
So basically, I want to display:
- the 15 records
- under which I have the 1 associated facility
- and see multiple payments (dataview) for the particular account
Again, currently, I cannot add new records under this structure. Any
advice???
&&&&& TABLE DESIGN &&&&&&&&&&&&
Link between tblFacility and tblAccount, and
between tblAccount and tblBills.
tblFacility
FacilityID 'Autonumber - Primary Key
FacilityName
'--- other columns
tblAccount
AccountID 'Autonumber - Primary Key
FacilityID 'Long Integer - Foreign Key to tblFacility.FacilityID
'--- other columns
tblBills
BillID 'Autonumber - Primary Key
AccountID 'Long Integer - Foreign Key to tblAccount.AccountID
'--- other columns
The relationships would be:
tblFacility.FacilityID (many) --> tblAccount.FacilityID (one)
tblAccount.AccountID (many) --> tblBills.AccountID (one)
&&&&& TABLE DESIGN &&&&&&&&&&&&
design for a relatively simple relationship such as:
This is the structure:
1. tblFacility
2. tblAccount
3. tblBills
Each facility has 1 or more accounts. Each account has 1 or more bills.
Although the reply below (within &&&) seems very logical and the results in
a query DO GIVE me the proper results, I am really having a hard time to
string the table in forms and subforms.
Currently, I am unable to enter a new record that would create a new
autonumber in each of the 3 tables.
Here's how I would like to have the form structure:
1. Account - Main form
2. Facility and Bills - Sub form.
Here's why I chose this main/sub form structure.
Let's say I have:
- 10 facilities
- 15 accounts (I may have more than 1 account per medical facility)
- 50 bills (I may have more than 1 payment per account and per facility).
So basically, I want to display:
- the 15 records
- under which I have the 1 associated facility
- and see multiple payments (dataview) for the particular account
Again, currently, I cannot add new records under this structure. Any
advice???
&&&&& TABLE DESIGN &&&&&&&&&&&&
Link between tblFacility and tblAccount, and
between tblAccount and tblBills.
tblFacility
FacilityID 'Autonumber - Primary Key
FacilityName
'--- other columns
tblAccount
AccountID 'Autonumber - Primary Key
FacilityID 'Long Integer - Foreign Key to tblFacility.FacilityID
'--- other columns
tblBills
BillID 'Autonumber - Primary Key
AccountID 'Long Integer - Foreign Key to tblAccount.AccountID
'--- other columns
The relationships would be:
tblFacility.FacilityID (many) --> tblAccount.FacilityID (one)
tblAccount.AccountID (many) --> tblBills.AccountID (one)
&&&&& TABLE DESIGN &&&&&&&&&&&&