Can't Concatenate Text to Text Field

Can't Concatenate Text to Text Field

Post by jillv » Thu, 17 Apr 2008 00:14:08

Hi All -- I've got a problem that I'm tearing my hair out over
because it seems so simple

I have a very simple table that I am trying to make a report out of so
that I can print out barcodes to correspond with the table's data.

Table: "FSource", Access 2003
FSID (pkey) (text) [Ex.: Local, Donation, Grant]
FSDescr (text) [Ex: "Purchased by department," "Donated from 3rd
party", "Funded by Grant"]

That's it, it's just a table I use for lookup values. I want the
report to print the barcode version of FSID (using my barcode font),
accompanied by the description in plain text. Seems easy enough...
add both fields, and set FSID to print using the Barcode font. Well,
to make a proper barcode, I need to surround FSID with two *s to make
*Local*, *Donation*, etc.

So, as I had done with my Locations report, which works and creates a
list of barcodes for each room, I set my control source for the field
="*" & [FSID] & "*"

And my result is: ERROR.

I feel like I am missing something completely obvious, but in
everything I read, if I'm concatenating text to text, I just need to
use the & operator. I DO have this same formula working on a
different text field in another report, and I remember it was
problematic then but I don't remember how I fixed it. I've tried
changing the field properties so they're exactly the same as the
working report's, but no dice! Any thoughts?

Thanks for your help!!

Can't Concatenate Text to Text Field

Post by Scott » Thu, 17 Apr 2008 00:48:30

It looks familiar to me since I've done it before (many times)....chances
are you need to simply rename the control. I would bet you started out with
just FSID in that field, then added the concatenation code; well, now it's
trying to concatenate to itself.

What I usually do is go to the Other tab of the control's properties, then
make the Name field say mFSID or fldFSID. Your code in the Data field seems
fine and I think will work after the name change.



Can't Concatenate Text to Text Field

Post by jillv » Thu, 17 Apr 2008 02:38:33

EUREKA! You were right on the money!! Seems like a bad idea to
default the control's name to the same as the field it's representing
just for this reason (are you listening, MS?).

It's still a mystery to me why it worked fine when I use a field that
was type Number, but hey .. not going to complain. :) Thanks Scott!!