Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Report textbox data does not pick up form textbox

Status
Not open for further replies.

0212

Technical User
Apr 2, 2003
115
US
Hi, all! Could you help me? I have a dialog box that I use to develop a filter for another form. When I open the form, I want to print a report based on the form. I can set the filter of the form to the report and it works. However, when I try to set the form's textbox (unbound) to the report textbox, the data does not transfer. The code is below. Does anyone have any ideas?

Private Sub PrintRpt2_Click()
On Error GoTo Err_PrintRpt2_Click

Dim stDocName As String
Dim sttext As String

stDocName = "RptFrmTrackRptDatesODR"
DoCmd.OpenReport stDocName, acPreview

Me.Filter = Reports!RptFrmTrackRptDatesODR.Filter
Me.Text118 = Reports!RptFrmTrackRptDatesODR.Text118.Value
Me.Text110 = Reports!RptFrmTrackRptDatesODR.Text110.Value
Exit_PrintRpt2_Click:
Exit Sub

Err_PrintRpt2_Click:
MsgBox Err.Description
Resume Exit_PrintRpt2_Click

End Sub
 
Perhaps the report's textbox is not yet populated.
You may try this (typed, untested):
Do
DoEvents
Me!Text118 = Reports!RptFrmTrackRptDatesODR!Text118.Value
Me!Text110 = Reports!RptFrmTrackRptDatesODR!Text110.Value
Loop While Trim(Me!Text118 & "") = ""

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Thanks for you quick response, PHV. However, it still does not work. In the Dialog Box Form VBA (attached to the 'ok' buttom) I use a Case Statement to set the value of the textbox in the other form, i.e. "30 days overdue". It shows up in the form's textbox, but not in the report's textbox (the report is identical to the form). I have a command button in the form to print the report. I even tried to use a global variable to hold the string. Do I need to give you more info? If so, can you let me know what? Thanks again for your help!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top