I have a monthly report that query a table for stats for various users with calculations and print results. I would like to capture those data to another table for year-to-date performance ratings.
I created a module that contains a public type Final Results variables. On the report module, upon closet it will (msgbox) ask if to save the result. When vbYes, it will save the reports data to the public variables and will open the year-to-date table and add new the data.
Here's my problem, when running the codes in the edit mode (F8), I can see the data being save on the public type variable but if run normally, the public variable will say <object variable not set>
Sample: Report Module
With YTDFinal
.EmpID = [txtEmpID]
.MONTH = [BEGDATE]
.SupvID = [txtSuprvId]
End With
set rst = dbs.open . . . . .("table name")
with rst
.AddNew
![EmpID] = YTDFinal.EmpID
![MONTH] = YTDFinal.MONTH
![SUPRVID] = YTDFinal.SupvID
with end
Will this save multi-user data? Is there a better way to accomplish this? Thanks
I created a module that contains a public type Final Results variables. On the report module, upon closet it will (msgbox) ask if to save the result. When vbYes, it will save the reports data to the public variables and will open the year-to-date table and add new the data.
Here's my problem, when running the codes in the edit mode (F8), I can see the data being save on the public type variable but if run normally, the public variable will say <object variable not set>
Sample: Report Module
With YTDFinal
.EmpID = [txtEmpID]
.MONTH = [BEGDATE]
.SupvID = [txtSuprvId]
End With
set rst = dbs.open . . . . .("table name")
with rst
.AddNew
![EmpID] = YTDFinal.EmpID
![MONTH] = YTDFinal.MONTH
![SUPRVID] = YTDFinal.SupvID
with end
Will this save multi-user data? Is there a better way to accomplish this? Thanks