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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sending a value into the report 2

Status
Not open for further replies.

TMRO

Technical User
Jan 10, 2003
140
CA
Hi!

Here is my scenario:
I have a report button on my form which is supposed to open a custom report. I want that one field from the report
to have the value from one textbox from the main form (where the report button was).

So in the report open event I added this line
Reports!MyReport!txtComment.Value = Forms!MyForm.txtComment.Value

The error that I'm getting is "You can't assign a value to this object" ???

What is wrong?

Thanks a lot,
TMRO
 
It is because the Report object has not been established yet in the Open Event. Put the same code in the OnFormat of the Report Header.

That should provide the data from the form in your report control. Bob Scriver
 
Add your Forms!MyForm... line in the ControlSource of the report field after the "=" sign.

Durug
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top