MsgBox - Display variable in MsgBox

S

Shiller

Experts,

Is there a way I can display a variable in a Message box (MsgBox)

For example the variable COLOR can be blue, black, green or red....

MsgBox "You own a COLOR truck", vbInformation + vbOKOnly

I tried to to put & &, " ", ' ' around COLOR so it can display the
actual color but it's not working.

Please help,

Shiller
 
B

Brendan Reynolds

Shiller said:
Experts,

Is there a way I can display a variable in a Message box (MsgBox)

For example the variable COLOR can be blue, black, green or red....

MsgBox "You own a COLOR truck", vbInformation + vbOKOnly

I tried to to put & &, " ", ' ' around COLOR so it can display the
actual color but it's not working.

Please help,

Shiller


MsgBox "You own a " & COLOR & " truck"
 
M

Michel Walsh

MsgBox "You own a " & COLOR & " truck", vbInformation + vbOKOnly



Vanderghast, Access MVP
 

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