Concatenate

  • Thread starter Thread starter Joel
  • Start date Start date
J

Joel

Hello,

I have been concatenating fields in forms without a problem. But... when I
do it with fields that are pulldowns, I get #Error.

Perhaps someone has a simple example of how to do this. Thank you much for
your help.

-Joel
 
Well, yes, they are look up fields. Thank you for the link... so is there
no way to join them?

-Joel
 
HI,


You can't concatenate a number and as string with +, but using & should
not be a problem... be sure you leave a space before and after the & and in
doubt, cast with a format or CStr:

Field1 & CStr( Field2 )

Note that CStr( NULL ) produces an error, so if Field2 can have NULL,
use

Field1 & Format( Field2 , "string" )

The combo box wizard suggest you hide a numerical "autonumber", if you
do so, which should, lookup or not, you see multiple columns, but not the
real one, which can be a number. Since:

" text" + 4


generates an error, also would

str + Me.ComboBox.Value


if the bound column is numerical (hidden). So, use either

str & Me.ComboBox

either

str + Format(Me.ComboBox, "string" )

as example.



Hoping it may help,
Vanderghast, Access MVP
 
Back
Top