Lable Captions In a Report

S

SDIrby

Hello all,
My problem is this: I have a report that pulls information off a tables
and a query, this report works fine as is. The problem is that i added
a new text box that holds parcel i.d. #'s. Well this is a report for a
county recorder and they are very particular about their reports. Two
counties need the label caption changed and i don't want to create a
whole new report and edit buttons and such.


So, I am wondering if there is a way to change the Label caption of a
text box depending on the contents of a Field on the report form.

I've tried
If [County] = "suffolk*" or "Fluvanna"
me.mylabel.caption = "Property/Tax I.D.#"
else
me.mylabel.caption = "Parcel I.D.#"

can this work or can something similar to this work. Just a push in
the right direction will more than suffice. I would appreciate any
help. Thank you in advance.
 
S

Steve Schapel

SD,

The general concept of what you are doing is ok. Where you put this
code is important... it should go in the Format or Print event of the
Section of the report where the label is located. And it looks like a
couple of refinements to the code would be required...

If Me.County = "Suffolk" Or Me.County = "Fluvanna" Then
Me.mylabel.Caption = "Property/Tax I.D.#"
Else
Me.mylabel.Caption = "Parcel I.D.#"
End If

.... or, if the * you had with Suffolk is meant to be a wildcard, maybe
you really need this...
If Me.County Like "Suffolk*" Or Me.County = "Fluvanna" Then
 
F

Fons Ponsioen

Would it not be easier to use an IIF such as:
IIF(Me.County = "Suffolk" Or Me.County
= "Fluvanna","Property/Tax I.D.#","Parcel I.D.#")
You would put this in the caption textbox.
Fons
-----Original Message-----
SD,

The general concept of what you are doing is ok. Where you put this
code is important... it should go in the Format or Print event of the
Section of the report where the label is located. And it looks like a
couple of refinements to the code would be required...

If Me.County = "Suffolk" Or Me.County = "Fluvanna" Then
Me.mylabel.Caption = "Property/Tax I.D.#"
Else
Me.mylabel.Caption = "Parcel I.D.#"
End If

.... or, if the * you had with Suffolk is meant to be a wildcard, maybe
you really need this...
If Me.County Like "Suffolk*" Or Me.County = "Fluvanna" Then

--
Steve Schapel, Microsoft Access MVP

Hello all,
My problem is this: I have a report that pulls information off a tables
and a query, this report works fine as is. The problem is that i added
a new text box that holds parcel i.d. #'s. Well this is a report for a
county recorder and they are very particular about their reports. Two
counties need the label caption changed and i don't want to create a
whole new report and edit buttons and such.


So, I am wondering if there is a way to change the Label caption of a
text box depending on the contents of a Field on the report form.

I've tried
If [County] = "suffolk*" or "Fluvanna"
me.mylabel.caption = "Property/Tax I.D.#"
else
me.mylabel.caption = "Parcel I.D.#"

can this work or can something similar to this work. Just a push in
the right direction will more than suffice. I would appreciate any
help. Thank you in advance.

.
 

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