Group:  Microsoft Access ยป microsoft.public.access.formscoding
Thread: Easy One - How to reference Label in report from Code

Geek News

Easy One - How to reference Label in report from Code
Angelsnecropolis 11/27/2008 12:58:01 AM
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?
Re: Easy One - How to reference Label in report from Code
"Allen Browne" <AllenBrowne[ at ]SeeSig.Invalid> 11/27/2008 1:24:55 AM
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
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Angelsnecropolis" <Angelsnecropolis[ at ]discussions.microsoft.com> wrote in
message
news:1E46FBD2-F1FD-4A4B-8FA6-08D32EF77479[ at ]microsoft.com...
[Quoted Text]
>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?

Home | Search | Terms | Imprint Contact
Newsgroups Reader - provided by WiredBox.Net