Question Textbox

locksp

Registered User.
Local time
Yesterday, 17:42
Joined
Sep 15, 2009
Messages
20
I have a text box containing a value on an open form. Can I display the value contained in the text box on a report that is subsequently generated by the form? If so, how? The value of the text box forms part of the title of the report.
 
Would I be correct in assuming that the text box is unbound?
 
Lets say that the title on the report is a label then you need to do the following on the report On Load event.

Me.LblReportTitle.Caption = "Anything here" & Forms("FormName")("FormControl") & " anything here"

As long as the form is open then it will capture the contents of the control in the label caption on the report.

The names FormName and FormControl are for brevity only and real form names and control names should be used.

David
 
Sorry, I'm new to Access and a little unfamiliar with what you have written. If I lay out what I'm after then the command will be clearer to me.

Form name = Calibration Information, Text box name = CMonths (numerical value)
Report name = Parameter Cal Due, Title required = Calibrations due in the next * months. * = value of CMonths.

Is you suggestion entered in the expression builder?

Thanks for your time
 
In the report header of your report you will have a label that displays the name of the report. Name this LblRptCaption.

Next Click on the properties of the report and click build to take you into the code area.

Code:
Private Sub Report_Open(Cancel As Integer)
Me.LblRptCaption.Caption = "Calibrations due in the next " & Forms("Calibration Information")("CMonths") & " Months"
End Sub

Save your report and run it via your form.

David
 
Dave

Thanks for your assistance. It now works.

Steve
 

Users who are viewing this thread

Back
Top Bottom