Write Values to Report Text Box`

crhodus

Registered User.
Local time
Today, 05:42
Joined
Mar 16, 2001
Messages
257
I have a text box that I've added to my report. I would like to be able to have the value entered into a text box on a form written to the text box that I've added to my report. How can I go about doing this?

I've tried adding
Code:
=IIF(IsNull( Forms![frmOnlinePaymentRptOptions]![txtFromDate]), "No From Date", Forms![frmOnlinePaymentRptOptions]![txtFromDate]))
to the Control Source of the report text box, but nothing happens.


Thanks,
Crhodus
 
Try this:

=IIF(IsNull([Forms]![frmOnlinePaymentRptOptions]![txtFromDate].Value), "No From Date", [Forms]![frmOnlinePaymentRptOptions]![txtFromDate].Value)

You do need to have that form open of course, or it won't work.
 
That looks okay, though there are too many closing parentheses at the end. The form would have to be open. In case the form control contains a ZLS instead of Null, try

IIf(Nz(Forms![frmOnlinePaymentRptOptions]![txtFromDate], "") = "",...
 
Also - the value on the report will not change if you change the record on the form without closing the report and opening it again.
 
Thanks for giving me the .value piece of code that I'm missing and telling me about thehe extra bracket.

Crhodus
 

Users who are viewing this thread

Back
Top Bottom