Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Retrieve Calculated Value in Report Footer

Status
Not open for further replies.

pdldavis

Technical User
Oct 29, 2001
522
US
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.

 
not to sure but try redim instead of dim

Hope this helps
Hymn
 
No, doesn't recognize redim but that's a thought. Does the Dim statement need to be 'flushed' or something?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top