Control value drive text display

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a control on a report, what I'd like to do is display the text "PAL"
if the content/value of the text/control is equal to -1, if the control's
value is 0, then, show "SFSV"

Is this possible? If it is how does one get it done?

Thanks,
 
Jay,

You can do this a couple of ways:

1) have a query be the control source for the report. In the query create a
new field and use the iff function like this: Newfield:
IIf([sourcefield]=-1,""PAL" ,"SFSV")

2) hide the current field on the report and create a new field and set the
new fields source to: =IIf([sourcefield]=-1,""PAL" ,"SFSV")

3) hide the current field and create a new field then in the format section
of the report write an event procedure that will check the current field and
then set the new field based upon the vale that is in the current field.
Something like:

if txtcurrentfield = -1 then
txtnewfield="PAL"
else
txtnewfield="SFSV"
end if

Hope this helps.

Dale
 
Dale:

Thanks, I think that this will work, just fine! Appreciate the assistance!

dkalsow said:
Jay,

You can do this a couple of ways:

1) have a query be the control source for the report. In the query create a
new field and use the iff function like this: Newfield:
IIf([sourcefield]=-1,""PAL" ,"SFSV")

2) hide the current field on the report and create a new field and set the
new fields source to: =IIf([sourcefield]=-1,""PAL" ,"SFSV")

3) hide the current field and create a new field then in the format section
of the report write an event procedure that will check the current field and
then set the new field based upon the vale that is in the current field.
Something like:

if txtcurrentfield = -1 then
txtnewfield="PAL"
else
txtnewfield="SFSV"
end if

Hope this helps.

Dale
Jay said:
I have a control on a report, what I'd like to do is display the text "PAL"
if the content/value of the text/control is equal to -1, if the control's
value is 0, then, show "SFSV"

Is this possible? If it is how does one get it done?

Thanks,
 
Jay said:
I have a control on a report, what I'd like to do is display the text "PAL"
if the content/value of the text/control is equal to -1, if the control's
value is 0, then, show "SFSV"


Another way that does not require any code/expressions is to
set the text box's Format property to a custom format. In
this case:
;"PAL";"SFSV"
 
Back
Top