Expression

M

Michelle

I have a DB that has a PW ID (an auto number field and primary key) in a
report I would like to combine that with a field called PW or add text before
the PWID.
Example.

PWID PW
1 ABC#$%
2 ABC#$%
3 ABC#$%
4 ABC#$%

my expression is =[pw]+[pwid] I get an error
I have also tried ="ABC#$%"+[pwid]

can this be done if so how?
 
M

Marshall Barton

Michelle said:
I have a DB that has a PW ID (an auto number field and primary key) in a
report I would like to combine that with a field called PW or add text before
the PWID.
Example.

PWID PW
1 ABC#$%
2 ABC#$%
3 ABC#$%
4 ABC#$%

my expression is =[pw]+[pwid] I get an error
I have also tried ="ABC#$%"+[pwid]


=[pw] & [pwid]
 
M

Michelle

Thanks, figured it was some little thing.

Marshall Barton said:
Michelle said:
I have a DB that has a PW ID (an auto number field and primary key) in a
report I would like to combine that with a field called PW or add text before
the PWID.
Example.

PWID PW
1 ABC#$%
2 ABC#$%
3 ABC#$%
4 ABC#$%

my expression is =[pw]+[pwid] I get an error
I have also tried ="ABC#$%"+[pwid]


=[pw] & [pwid]
 
M

Marshall Barton

Little thing indeed ;-)

The problem is that while + will concatenate two strings, it
gets confused when one of them is a number. You could also
have used =[pw] + CStr([pwid])

Using + to concatenate two strings can be very useful when
one of them might be Null. E.g. =fn & (" " + mi) & " " & ln
For all other situationa, I recommend using &
--
Marsh
MVP [MS Access]

Thanks, figured it was some little thing.
Michelle said:
I have a DB that has a PW ID (an auto number field and primary key) in a
report I would like to combine that with a field called PW or add text before
the PWID.
Example.

PWID PW
1 ABC#$%
2 ABC#$%
3 ABC#$%
4 ABC#$%

my expression is =[pw]+[pwid] I get an error
I have also tried ="ABC#$%"+[pwid]

Marshall Barton said:
=[pw] & [pwid]
 

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