G
Guest
I am creating a database that lists all furniture in a building. Several
reports are run based on the information entered on each item of furniture
input by the user. In order to save time entering the building name on each
report, I created a seperate table to type in all project information (this
way I can add a field to the report that changes based on what is entered in
the table instead of the user having to edit each report individually).
Everything was going great. I didn't have any relationships setup between the
two since there were really no related fields.
Then I realized that we needed a freight allowance, which is a percentage
that is tacked on to the grand total. At first I added it to the Item table,
but we didn't want anyone to change the percentage of one item and not all
items. It was supposed to be one percentage for the entire project. I decided
to add it to the Project table.
This is when the problem started. It actually works fine for most
applications. I created a query that just pulled all fields from the Project
table and all items from the Item table. I then have other queries that use
that query as it's base.
Then there is the form. Originally, I was pulling data for the form from a
query [Item Details] that got information from the Item table, plus added new
calculation fields. That query has some other relationships to a Fabric
table. So I created another query [Item Detail and Project Info] that pulls
all fields from Item Detail query and the Project Info Table.
When I tried changing the data source of the form from the [Item Details]
query to the [Item Detail and Project Info] query, the information in the
form was not editable. I found that it was because there was no relationship
between the two information sources in the query.
So I decided I had to create a relationship between the two tables. I
created a [ProjectNumber] field in the Item table. Okay, great, but now the
user has to add the project number to each item, but generally every item in
the database is linked to the same project.
I did create a one to many relationship with "enforce referential integrety"
checked and "cascade update" checked, but how can I force each item to insert
the project number by default?
reports are run based on the information entered on each item of furniture
input by the user. In order to save time entering the building name on each
report, I created a seperate table to type in all project information (this
way I can add a field to the report that changes based on what is entered in
the table instead of the user having to edit each report individually).
Everything was going great. I didn't have any relationships setup between the
two since there were really no related fields.
Then I realized that we needed a freight allowance, which is a percentage
that is tacked on to the grand total. At first I added it to the Item table,
but we didn't want anyone to change the percentage of one item and not all
items. It was supposed to be one percentage for the entire project. I decided
to add it to the Project table.
This is when the problem started. It actually works fine for most
applications. I created a query that just pulled all fields from the Project
table and all items from the Item table. I then have other queries that use
that query as it's base.
Then there is the form. Originally, I was pulling data for the form from a
query [Item Details] that got information from the Item table, plus added new
calculation fields. That query has some other relationships to a Fabric
table. So I created another query [Item Detail and Project Info] that pulls
all fields from Item Detail query and the Project Info Table.
When I tried changing the data source of the form from the [Item Details]
query to the [Item Detail and Project Info] query, the information in the
form was not editable. I found that it was because there was no relationship
between the two information sources in the query.
So I decided I had to create a relationship between the two tables. I
created a [ProjectNumber] field in the Item table. Okay, great, but now the
user has to add the project number to each item, but generally every item in
the database is linked to the same project.
I did create a one to many relationship with "enforce referential integrety"
checked and "cascade update" checked, but how can I force each item to insert
the project number by default?