From: Kenny G on
Access 2007

When I click the command button below it will allow the view of a report and
sometimes it will give me the message "Runtime Error 6 Overflow". At that
time the line DoCmd.OpenReport "Single Unit Restraints Reporting For Selected
Timeframe", is highlighted in yellow. Any idea what the problem is?

Private Sub cmdSelectSingleUnitForReport_Click()
DoCmd.SetWarnings False
DoCmd.OpenQuery "qupdtUnit"
DoCmd.Requery
DoCmd.SetWarnings True
DoCmd.OpenReport "Single Unit Restraints Reporting For Selected
Timeframe", acViewPreview
End Sub

Thank you,
--
Kenny G
From: John Spencer on
That usually means that you have too large a number being assigned to a field.
For instance, you have an integer field that you are trying to sum and the
sum exceeds 32K. If that happens, you might need to set the number type of
the field to LONG even though you never store a number that is larger than
1000. The sum of the number can exceed the 32K limit.

Basically the sum "field" inherits the data type of the field that is being
summed.

John Spencer
Access MVP 2002-2005, 2007-2010
The Hilltop Institute
University of Maryland Baltimore County

Kenny G wrote:
> Access 2007
>
> When I click the command button below it will allow the view of a report and
> sometimes it will give me the message "Runtime Error 6 Overflow". At that
> time the line DoCmd.OpenReport "Single Unit Restraints Reporting For Selected
> Timeframe", is highlighted in yellow. Any idea what the problem is?
>
> Private Sub cmdSelectSingleUnitForReport_Click()
> DoCmd.SetWarnings False
> DoCmd.OpenQuery "qupdtUnit"
> DoCmd.Requery
> DoCmd.SetWarnings True
> DoCmd.OpenReport "Single Unit Restraints Reporting For Selected
> Timeframe", acViewPreview
> End Sub
>
> Thank you,