Hi, all! Hope you can help! I tried to total a column in my report and I received "#error" in the textbox. I used
=Sum([BudgTot]) in a textbox in the footer of the report. I did the exact thing to total a form (form and report look exactly the same) and it worked beautifully. The report is called from the form using a command button on the form.
Here is the code attached to the command button:
Private Sub Print_Report_Click()
On Error GoTo Err_Print_Report_Click
Dim stDocName As String
Dim PrintDoc As Integer
stDocName = "RptFRM_3_8_2007_Budget_Form"
DoCmd.OpenReport stDocName, acPreview
PrintDoc = MsgBox("Print Report?", vbYesNo + vbDefaultButton1)
If PrintDoc = 6 Then
DoCmd.PrintOut
End If
Exit_Print_Report_Click:
Exit Sub
Err_Print_Report_Click:
MsgBox Err.Description
Resume Exit_Print_Report_Click
When the report is opened I used all the information contained in the form (see code below)to generate the report:
Private Sub Report_Open(Cancel As Integer)
Me.FilterOn = True
Me.Filter = Forms!FRM_3_8_2007_Budget_Form.Filter
Me.OrderByOn = True
Me.OrderBy = Forms!FRM_3_8_2007_Budget_Form.OrderBy
'Me!TDollars = Forms!FRM_3_8_2007_Budget_Form.TDollars
'Me!TRptType = Forms!FRM_3_8_2007_Budget_Form.TRptType
End Sub
Any ideas?
=Sum([BudgTot]) in a textbox in the footer of the report. I did the exact thing to total a form (form and report look exactly the same) and it worked beautifully. The report is called from the form using a command button on the form.
Here is the code attached to the command button:
Private Sub Print_Report_Click()
On Error GoTo Err_Print_Report_Click
Dim stDocName As String
Dim PrintDoc As Integer
stDocName = "RptFRM_3_8_2007_Budget_Form"
DoCmd.OpenReport stDocName, acPreview
PrintDoc = MsgBox("Print Report?", vbYesNo + vbDefaultButton1)
If PrintDoc = 6 Then
DoCmd.PrintOut
End If
Exit_Print_Report_Click:
Exit Sub
Err_Print_Report_Click:
MsgBox Err.Description
Resume Exit_Print_Report_Click
When the report is opened I used all the information contained in the form (see code below)to generate the report:
Private Sub Report_Open(Cancel As Integer)
Me.FilterOn = True
Me.Filter = Forms!FRM_3_8_2007_Budget_Form.Filter
Me.OrderByOn = True
Me.OrderBy = Forms!FRM_3_8_2007_Budget_Form.OrderBy
'Me!TDollars = Forms!FRM_3_8_2007_Budget_Form.TDollars
'Me!TRptType = Forms!FRM_3_8_2007_Budget_Form.TRptType
End Sub
Any ideas?