K
Kurt Heisler
I'm trying to use Allen Browne's carry over function (http://
allenbrowne.com/ser-24.html) to carry over (i.e., copy) data from the
previous record to a new record. In my case, however, the data I need
to carry over are spread across *three* tables (instead of one table,
which is what I think his code was designed to handle).
Can his code be adjusted to make this work?
Here's the situation:
One patient can have many daily records, so there's a one:to:many
between tblPatients and tblDaily. I exceeded the field limit for
tblDaily, so I've split it into three tables linked together via a
1:1. (Long story, but it's as normalized as possible given some of the
restrictions on how the users want the data handled.)
The three tables look like this:
tblDailyOne
--------
*DailyDataID (AutoNumber)
PtID
HospitalDay
etc.
tblDailyTwo
--------
*DailyDataID (Number)
PtID
FieldABC
etc.
tblDailyThree
--------
*DailyDataID (Number)
PtID
FieldXYZ
etc.
When the user enters a record in tblDailyOne (via frmDaily), an update
query runs and populates the other two tables with the corresponding
DailyDataID and PtID. The user finishes entering the rest of the
record (i.e., the fields in tblDailyTwo & tblDailyThree) using several
subforms which are based on select queries from either tblDailyTwo or
tblDailyThree. The subforms are linked to frmDaily via DailyDataID.
So far so good.
Now I'm trying to use Allen Browne's carry over function to carry over
the previous record (which is spread across three tables) to the next
record (which will also be spread across the three tables). The
carryover function works fine for data entered on frmDaily (i.e., in
tblDailyOne), but not for data entered via the subforms (i.e., in the
other 2 tables). For these subforms (and tables), nothing is carried
over and there is no error message. This is true even though I've
applied the BeforeInsert property (=CarryOver([Form], "") to *each*
subform. I suspect the problem is that Browne's code assumes that data
is being carried over from one table, not three.
Any idea how I can edit his code to make this happen?
Thank you.
allenbrowne.com/ser-24.html) to carry over (i.e., copy) data from the
previous record to a new record. In my case, however, the data I need
to carry over are spread across *three* tables (instead of one table,
which is what I think his code was designed to handle).
Can his code be adjusted to make this work?
Here's the situation:
One patient can have many daily records, so there's a one:to:many
between tblPatients and tblDaily. I exceeded the field limit for
tblDaily, so I've split it into three tables linked together via a
1:1. (Long story, but it's as normalized as possible given some of the
restrictions on how the users want the data handled.)
The three tables look like this:
tblDailyOne
--------
*DailyDataID (AutoNumber)
PtID
HospitalDay
etc.
tblDailyTwo
--------
*DailyDataID (Number)
PtID
FieldABC
etc.
tblDailyThree
--------
*DailyDataID (Number)
PtID
FieldXYZ
etc.
When the user enters a record in tblDailyOne (via frmDaily), an update
query runs and populates the other two tables with the corresponding
DailyDataID and PtID. The user finishes entering the rest of the
record (i.e., the fields in tblDailyTwo & tblDailyThree) using several
subforms which are based on select queries from either tblDailyTwo or
tblDailyThree. The subforms are linked to frmDaily via DailyDataID.
So far so good.
Now I'm trying to use Allen Browne's carry over function to carry over
the previous record (which is spread across three tables) to the next
record (which will also be spread across the three tables). The
carryover function works fine for data entered on frmDaily (i.e., in
tblDailyOne), but not for data entered via the subforms (i.e., in the
other 2 tables). For these subforms (and tables), nothing is carried
over and there is no error message. This is true even though I've
applied the BeforeInsert property (=CarryOver([Form], "") to *each*
subform. I suspect the problem is that Browne's code assumes that data
is being carried over from one table, not three.
Any idea how I can edit his code to make this happen?
Thank you.