SetValue returns Type mismatch... WHY?!?!

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

Guest

I'm trying to generate a simple report in Access that, for each record, will
display the value of one data field if another data field contains the text
"see below". This ought to be an easy thing to do, but I'm having a very
difficult time and the online help is no help at all. I get a "Type
mismatch" error using the following macro:

[Reports]![MyReport]![Text15]=String(80,[Reports]![MyReport]![Long
Description]), ([Reports]![MyReport]![Short Description] Like "see below")

WHAT do I have to do to get this to work?? The Text15 text box is unbound in
my report design. The data type of [Long Description] is memo, which is why
I'm using the String function to only get the first 80 characters. I've also
set the properties of the text box for "Can Grow" = Yes. What else do I have
to do?? Am I not allowed to use SetValue in a macro to set the value of an
unbound textbox?!?!?! That makes no sense!!!

PLEASE HELP!!!! :(
 
What do you think that statement should result in?

If the syntax was correct, the String function wouldn't give you the first
80 characters of the Long Description: it would repeat the first character
of the field 80 times. To get the first 80 characters, you want

Left([Reports]![MyReport]![Long Description], 80)

I'm not sure what the

, ([Reports]![MyReport]![Short Description] Like "see below")

is there for, though, so I can't offer any more help.
 
Pgillis,

Like Doug, I can't figure out what you are doing here. You mentioned a
SetValue macro action, but did not mention which event you are trying to
run this macro on. SetValue has two arguments: Item and Expression.
Every which way I twist the information you gave, I can't see how it
fits into those arguments, so can you please clarify?

An alternative approach, though, might be to make a calculated field in
the query that the report is based on, and then you can just put a
textbox directly onto the report bound to this calculated field.
 
Back
Top