Since reading values from calculated controls in Access 2000 and 2002 from
code has proven unrliable at best, and since I like to avoid running
separate queries to calculate sums of subform records since they can give
inconsistent results if there's more than on interface or user with access
to the table, I wrote code to loop through a subform's RecordsetClone to
calculate aggregate values.
This approach worked fine until I moved to a master record with no related
records in the subform. After moving to that record, the subform returned
an empty recordset clone from then on even after I moved back to a parent
row with related records, and they appeared in the subform.
The work-around I came up with was to write a function that takes a form as
a parameter and returns the form's RecordsetClone if the form has a record
count > 1 not counting the new record if the current record is new. If the
form's record count is zero, the function returns Nothing, and does not
attempt to access the form's RecordsetClone. This solved the problem.
Just thought y'all might want to know.
- Steve Jorgensen
----
I would have written you a shorter program,
but I didn't have the time.
code has proven unrliable at best, and since I like to avoid running
separate queries to calculate sums of subform records since they can give
inconsistent results if there's more than on interface or user with access
to the table, I wrote code to loop through a subform's RecordsetClone to
calculate aggregate values.
This approach worked fine until I moved to a master record with no related
records in the subform. After moving to that record, the subform returned
an empty recordset clone from then on even after I moved back to a parent
row with related records, and they appeared in the subform.
The work-around I came up with was to write a function that takes a form as
a parameter and returns the form's RecordsetClone if the form has a record
count > 1 not counting the new record if the current record is new. If the
form's record count is zero, the function returns Nothing, and does not
attempt to access the form's RecordsetClone. This solved the problem.
Just thought y'all might want to know.
- Steve Jorgensen
----
I would have written you a shorter program,
but I didn't have the time.
Comment