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!

How to set a textbox value in report from a form ?

Status
Not open for further replies.

uhu

IS-IT--Management
May 21, 2003
40
NZ
Hi everyone,

How can I set a value of a textbox in a report from a form using VBA ? Can anyone give me an example ?

The label in the report is : Text1
Report Name : SalesReport

cheers,
vito
 
Hi uhu,

Paste this into the declarations section of a Module:

Global gReportTextValue As String

Use this as your code to open the report:

gReportTextValue = "uhu "
DoCmd.OpenReport "SalesReport", acViewPreview

Paste this into the On Open event of your Report:

Me!Text1 = gReportTextValue

Bill
 
Hi Bill,

Thanks for your reply. I tried this on my report, and it still produces error.

Private Sub PageHeaderSection_Format(Cancel As Integer, FormatCount As Integer)
Me!Text1 = "vito"
End Sub

cheers
vito
 
Hi uhu,

I did say try using this in the On Open event of your Report.

From your very brief questions I'm not exactly sure what you're tryin to do.

Bill
 
Thanks bill,

it works now, just forgot to include .Value when inputting "vito"

:)

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top