building strings with text and fields

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

Guest

I need a good book on how to do this because I am forever having to post a
question about it and I just haven't learned yet! Please forgive my
continued ignorance.

I have two fields in a report record source: [CombinePoints] which is a
yes/no field, and [CombineYear] which is a numeric field.

If the value of the [CombinePoints] field is -1, I want a text box in the
report to print "Student has combined points since [CombineYear]", otherwise
leave it blank.

Here's what I've tried that doesn't give me the results I want:

=IIf([CombinePoints]=-1,"Student has combined points since " &
[CombineYear]","")

I know it all has to do with the "then" segment in the middle; I'm just not
writing it correctly. I fumble over the single quotes, double quotes,
ampersands, etc.

If in giving me the solution you could share some general principles I'd
love it!

Thanks in advance.

Jerry
 
JWCrosby said:
I need a good book on how to do this because I am forever having to
post a question about it and I just haven't learned yet! Please
forgive my continued ignorance.

I have two fields in a report record source: [CombinePoints] which is
a yes/no field, and [CombineYear] which is a numeric field.

If the value of the [CombinePoints] field is -1, I want a text box in
the report to print "Student has combined points since
[CombineYear]", otherwise leave it blank.

Here's what I've tried that doesn't give me the results I want:

=IIf([CombinePoints]=-1,"Student has combined points since " &
[CombineYear]","")

I know it all has to do with the "then" segment in the middle; I'm
just not writing it correctly. I fumble over the single quotes,
double quotes, ampersands, etc.

If in giving me the solution you could share some general principles
I'd love it!

At the end of this segment you open a quoted string...

IIf([CombinePoints]=-1,"

....and at the en of this segment you close it...

points since "

Now here you close a quoted string that was never opened...

CombineYear]"

Lose that quote.
 
Thanks, Rick. I was close, wasn't I?

Rick Brandt said:
JWCrosby said:
I need a good book on how to do this because I am forever having to
post a question about it and I just haven't learned yet! Please
forgive my continued ignorance.

I have two fields in a report record source: [CombinePoints] which is
a yes/no field, and [CombineYear] which is a numeric field.

If the value of the [CombinePoints] field is -1, I want a text box in
the report to print "Student has combined points since
[CombineYear]", otherwise leave it blank.

Here's what I've tried that doesn't give me the results I want:

=IIf([CombinePoints]=-1,"Student has combined points since " &
[CombineYear]","")

I know it all has to do with the "then" segment in the middle; I'm
just not writing it correctly. I fumble over the single quotes,
double quotes, ampersands, etc.

If in giving me the solution you could share some general principles
I'd love it!

At the end of this segment you open a quoted string...

IIf([CombinePoints]=-1,"

....and at the en of this segment you close it...

points since "

Now here you close a quoted string that was never opened...

CombineYear]"

Lose that quote.
 
Back
Top