jadams0173
Technical User
- Feb 18, 2005
- 1,210
Can I set the control Source for an unbound text box in the footer of my report thru code. When I do it this way I get prompted for a paramater and the label of the input for the parameter has the value of my DSum.
Code:
Private Sub Report_Open(Cancel As Integer)
Dim sql As String
Dim TempReport As String
Dim RelDate As Date
Dim tt As Integer
DoCmd.SetWarnings False
RelDate = Format(Now(), "mm/dd/yyyy")
TempReport = "Report_" & Environ("username")
'Debug.Print DATE
sql = "SELECT data" _
& "INTO " & TempReport
DoCmd.RunSQL sql
[red]Me!txtFeederTotal.ControlSource = DSum("[FEEDERTOTAL]", TempReport)[/red]
Reports!rpt_wh_feederload_requirements.RecordSource = TempReport
DoCmd.SetWarnings True
End Sub
I've tried it before and after setting the recordsource for the report.