Combining Formula and Text question

C

codwilco

Pretty simple. Why does this work (="Dear "+[EmpName]+",") and this does
not(="Count: "+Count(EmployeeDetail!SSN))? The second returns #Error. And
yet, if I remove the text, the Count function works just fine. I just need
the two combined.

Thanks,
Dave
 
A

Allen Browne

Try an ampersand:
="Count: " & Count(EmployeeDetail!SSN)

The plus sign is ambiguous. It can mean concatenation (for text) or
summation (for numbers.) Your second example tries to combine a text and a
number, so Access got confused about which to do and errored out.

If you really want to use the plus, you could use Str() to force the number
to string:
="Count: " + Str(Count(EmployeeDetail!SSN))
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top