I’ve a table with 90 different fields named grp00, grp01, grp02, grp03, etc.
The table has one field for the report date (RptDt) and one field for operator ID’s.
Each day I need to update the count of records for each group for each operator ID.
I was hoping to update the table by using a couple of loops to cycle through the recordsets for each group for each operator ID.
This works
rst!Grp00 = GrpCnt
but when I try to use the variable, xx in the rst!Grpxx = GrpCnt to replace the ‘00’ it doesn’t work. Is it possible to make it work? If so please provide the example?
This doesnt work
rst!Grp" & ‘" & xx & "’ = & GrpCnt
I can use an update query, I think, but I haven’t tried it yet. It seems to me it would be a huge query considering the 90 fields to update. Plus I’d hate to edit the query in the future; it’d be a whole lot easier to just add a couple of columns to the table.
Or am I stuck with
rst!Grp00 = GrpCnt00
rst!Grp01 = GrpCnt01
rst!Grp02 = GrpCnt02
rst!Grp03 = GrpCnt03
The purpose of the design is to be able to provide a report that looks like
RptDt OpID Grp00 Grp01 Grp02 Grp03
3/28/08 Tu312 45 15 12 88
3/28/08 Tu792 22 45 78 26
The table has one field for the report date (RptDt) and one field for operator ID’s.
Each day I need to update the count of records for each group for each operator ID.
I was hoping to update the table by using a couple of loops to cycle through the recordsets for each group for each operator ID.
This works
rst!Grp00 = GrpCnt
but when I try to use the variable, xx in the rst!Grpxx = GrpCnt to replace the ‘00’ it doesn’t work. Is it possible to make it work? If so please provide the example?
This doesnt work
rst!Grp" & ‘" & xx & "’ = & GrpCnt
I can use an update query, I think, but I haven’t tried it yet. It seems to me it would be a huge query considering the 90 fields to update. Plus I’d hate to edit the query in the future; it’d be a whole lot easier to just add a couple of columns to the table.
Or am I stuck with
rst!Grp00 = GrpCnt00
rst!Grp01 = GrpCnt01
rst!Grp02 = GrpCnt02
rst!Grp03 = GrpCnt03
The purpose of the design is to be able to provide a report that looks like
RptDt OpID Grp00 Grp01 Grp02 Grp03
3/28/08 Tu312 45 15 12 88
3/28/08 Tu792 22 45 78 26