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

alter report data at run-time. 1

Status
Not open for further replies.

bronc

Instructor
Aug 28, 2003
145
GB
I can create an unbound text box in the detail section of my report.

This text box refers to another control on the report called "Person" when I place this expression in the unbound text box...

=IIf([Person]="ed",1,2)

.. sure enough it gives 1 whenever the Person control is "ed" and 2 otherwise.

Is there a way of doing the same thing from code - eg in the Detail_Format event?
 
You can set the value of an unbound text box (nothing in the control source). I'm not sure what you objective might be when the expression you used is simpler than code.

Duane
Hook'D on Access
MS Access MVP
 
yes i agree. I'm just giving a cut-down example. The unbound text box actually collects its value from many bound text box controls and the required expression is very complex tho i will have to do that if there is no way to do it from code. I just need to determine if its possible in principle to do it from code - i suspect not.
 
I just suggested you can set the value as long as the control has nothing in the Control Source property.

You can only reference values bound to controls in the report.

If you have some troubles doing this, come back with more specifics such as field and control names.

Duane
Hook'D on Access
MS Access MVP
 
Oh I didn't realize what you were saying. I cleared the unbound text box and sure enough I could place data in it from the Detail_Format event. A very useful simple tip - I'm not sure why it works but I am most grateful.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top