I have a report that calls a number of subreports. I also have totals at the end of each grouping and at the end of the report that use code to get totals for a particular record. The code uses DAO to get the totals (as they came from different tables and it became too complex to total from the subreports). However when I run the report I get an error message - "Can't open anymore databases"
the code goes something like this -
Function GetTotal(id) as double
Dim dbs as Database
Dim rst as Recordset
set rst = dbs.openrecordset(sdtrSQL, dbopensnap)
....
....
rst.close
dbs.close
set rst = nothing
set dbs = nothing
end function
the tables are in a linked database. but this code get called quite a bit when running the report. Do I need to do this in another way? Can anyone help with this?
cheers
vic.
the code goes something like this -
Function GetTotal(id) as double
Dim dbs as Database
Dim rst as Recordset
set rst = dbs.openrecordset(sdtrSQL, dbopensnap)
....
....
rst.close
dbs.close
set rst = nothing
set dbs = nothing
end function
the tables are in a linked database. but this code get called quite a bit when running the report. Do I need to do this in another way? Can anyone help with this?
cheers
vic.