MsgBox - Display variable in MsgBox

  • Thread starter Thread starter Shiller
  • Start date Start date
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
 
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"
 
MsgBox "You own a " & COLOR & " truck", vbInformation + vbOKOnly



Vanderghast, Access MVP
 
Back
Top