Easy One - How to reference Label in report from Code

A

Angelsnecropolis

I need the caption of a Label in a report to change depending on whether or
not a combobox on a form has data typed in or no data typed in.

Help?
 
A

Allen Browne

In report design view, right-click the label and:
Change To | Text Box

Set the Control Source property of this text box to:
=[Forms].[Form1].[Text0]
using the name of your form instead of Form1, and the name of the text box
on the form instead of Text0.

Or perhaps you want an expression such as:
=IIf([Forms].[Form1].[Text0] Is Null, Null, "It has data")

Note that:
a) The form must be open for this to work, and
b) It will give the same answer for all records on the report.

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

message
news:[email protected]...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top