I have a data entry form with a command button to open a report form. I open the report using VB, and then I try to populate unbound text boxes on the report, I get no results. I'm thinking I need to requery the report form or something for these values to show up, but I can't use Requery...
MSAccess 2007
Windows Vista
Here's the code:
Public Sub PrintRpt_Click()
On Error GoTo Error_Handler
DoCmd.OpenReport "rpt_Calculation", acViewPreview
Reports![rpt_Calculation]!rptRepeatKey = RepeatKey
Reports![rpt_Calculation]!rptWorkflowKey = WorkflowKey
Reports![rpt_Calculation]!rptUtilizationKey = UtilizationKey
Reports![rpt_Calculation]!rptIBkey = IBKey
Reports![rpt_Calculation]!rptBCkey = BCKey
Reports![rpt_Calculation]!rptCustSel = TempVars("CustName").Value
Exit_Procedure:
Exit Sub
Error_Handler:
MsgBox "Error # " & Err.Number & vbCrLf & Err.Description, vbExclamation, "Application Error"
Resume Exit_Procedure
End Sub
In debug, all the fields have correct values in them, but when I look at the report, they are all blank... All unbound text boxes in the form are named the same way as here - rptRepeatKey, etc...
Please help. Thanks SO SO much!