Hi, I need to retrieve a calculated value in a report footer for use as the maximum value in a graph. This seems to work correctly one time.
The value it pulls the first time is 27351.8, which is correct and the graph works fine.
I run it again and I get a garbage number - 3672.75. This number does not change even if I change the data behind the report.
If I delete the form, quit the database and rebuild the form, the value I want comes in correctly... once. Then the same other number - 3672.75 if I run it again.
I'm a little bit baffled. Below is the code I use.
Dim x
DoCmd.OpenReport "rptTurnoverMt", acViewPreview
x = [Reports]![rptTurnoverMt]![txtTotalCount]
Me.txtTotalQty = x
MsgBox x
DoCmd.Close acReport, "rptTurnoverMt", acSaveNo
Any help would be appreciated - I'm at a loss with this one.
The value it pulls the first time is 27351.8, which is correct and the graph works fine.
I run it again and I get a garbage number - 3672.75. This number does not change even if I change the data behind the report.
If I delete the form, quit the database and rebuild the form, the value I want comes in correctly... once. Then the same other number - 3672.75 if I run it again.
I'm a little bit baffled. Below is the code I use.
Dim x
DoCmd.OpenReport "rptTurnoverMt", acViewPreview
x = [Reports]![rptTurnoverMt]![txtTotalCount]
Me.txtTotalQty = x
MsgBox x
DoCmd.Close acReport, "rptTurnoverMt", acSaveNo
Any help would be appreciated - I'm at a loss with this one.