L
LAF
A great strength of Access is the ability to base a form on a multi-table
query and use the form for data entry. However, there are some important
issues. Let us assume a simple database with two master tables and a
junction table. One master table (subjects) has a primary key that is a text
variable. The other master table is an event table with an autonumbered
EventID as primary key. Assume for this example that tblEventID has fields
EventID, Site, Date, Time.
Issue 1. Should there be a single bound data entry form that has all fields
from all 3 tables? For this to occur, code or macro must be written to run
after the SubjectID is entered in the SubjectID field from tblSubjecst, to
determine if a new record should be written in the subjects table. If a new
record does not need to be made, then the SubjectsID field should be cleared,
but the SubjectsID value placed in the SubjectsID field from tblJunction.
Issue 2. A bigger problem occurs when data are entered for tblEvent on the
single bound entry form. Code or macro must be written to determine if the
non-primary key fields are already present in tblEvents. If they are, then
the EventID from the matching record should be copied into EventID field on
the data entry form for tblEvents. If not, then a new record must be written
into tblEvent and the autonumber copied into the data transfer form.
The big question is: should there be separate data entry forms for the two
master tables, possibly on unbound forms that pass appropriate values to the
relevant data entry forms, or to an error event? The tblJunction data entry
form would start out with the passed values in the foreign key fields. Is
there a better strategy for dealing data entry with referential integrity and
cascade updating.
LAF
query and use the form for data entry. However, there are some important
issues. Let us assume a simple database with two master tables and a
junction table. One master table (subjects) has a primary key that is a text
variable. The other master table is an event table with an autonumbered
EventID as primary key. Assume for this example that tblEventID has fields
EventID, Site, Date, Time.
Issue 1. Should there be a single bound data entry form that has all fields
from all 3 tables? For this to occur, code or macro must be written to run
after the SubjectID is entered in the SubjectID field from tblSubjecst, to
determine if a new record should be written in the subjects table. If a new
record does not need to be made, then the SubjectsID field should be cleared,
but the SubjectsID value placed in the SubjectsID field from tblJunction.
Issue 2. A bigger problem occurs when data are entered for tblEvent on the
single bound entry form. Code or macro must be written to determine if the
non-primary key fields are already present in tblEvents. If they are, then
the EventID from the matching record should be copied into EventID field on
the data entry form for tblEvents. If not, then a new record must be written
into tblEvent and the autonumber copied into the data transfer form.
The big question is: should there be separate data entry forms for the two
master tables, possibly on unbound forms that pass appropriate values to the
relevant data entry forms, or to an error event? The tblJunction data entry
form would start out with the passed values in the foreign key fields. Is
there a better strategy for dealing data entry with referential integrity and
cascade updating.
LAF