B
Bonnie
Hi there! Using A02 on XP. Have a data entry form that
assigns points to various selections and has a field
[Total] calculating as you go. When finished, I need to
copy the [Total] sum to [Points] and then view the report.
(I need the final result to be recorded in a linked table
for future reference.) When I click the button, I can see
the field update but then I get Runtime Error 2501 - The
RunCommand Action was cancelled. If I don't save the
record, my report prints without the updates/edits. Here
is my event code:
Private Sub Preview_Click()
Me.Points = Me.Total
DoCmd.RunCommand acCmdSaveRecord
On Error GoTo Err_Preview_Click
Dim stDocName As String
stDocName = "rPoints"
DoCmd.OpenReport stDocName, acPreview, , "[PointsNum]
=" & [PointsNum]
DoCmd.RunCommand acCmdZoom100
Exit_Preview_Click:
Exit Sub
Err_Preview_Click:
MsgBox Err.Description
Resume Exit_Preview_Click
End Sub
I hope it's something simple but cannot figure out why I
cannot put a final save on the data before the report
opens up. Thanks in advance for any and all help or
advice. I love you guys!
assigns points to various selections and has a field
[Total] calculating as you go. When finished, I need to
copy the [Total] sum to [Points] and then view the report.
(I need the final result to be recorded in a linked table
for future reference.) When I click the button, I can see
the field update but then I get Runtime Error 2501 - The
RunCommand Action was cancelled. If I don't save the
record, my report prints without the updates/edits. Here
is my event code:
Private Sub Preview_Click()
Me.Points = Me.Total
DoCmd.RunCommand acCmdSaveRecord
On Error GoTo Err_Preview_Click
Dim stDocName As String
stDocName = "rPoints"
DoCmd.OpenReport stDocName, acPreview, , "[PointsNum]
=" & [PointsNum]
DoCmd.RunCommand acCmdZoom100
Exit_Preview_Click:
Exit Sub
Err_Preview_Click:
MsgBox Err.Description
Resume Exit_Preview_Click
End Sub
I hope it's something simple but cannot figure out why I
cannot put a final save on the data before the report
opens up. Thanks in advance for any and all help or
advice. I love you guys!