Combined text and variable in a message box

  • Thread starter Thread starter vrzimmerm
  • Start date Start date
V

vrzimmerm

I'm trying to display message box that combines text along with a
variable that was previously defined. The following code only
displays the date that's contained in the variable Dt, but it doesn't
display the text. How can this be done?


Dt = "Records prior to " & Dt & " have been removed"
MsgBox Dt

Thanks.
 
This works just fine for me.
Dt = 5
Dt = "Records prior to " & Dt & " have been removed"
MsgBox Dt

Not sure why it's not working for you. You could always use something
like:
Dt = 5
MsgBox "Records prior to " & Dt & " have been removed"
or
Dt = 5
msgString = "Records prior to " & Dt & " have been removed"
MsgBox msgString
 
Hi

your code seems ok though it looks like you are changing the data held
in Dt to the string of text rather than your date variable??

MsgBox "Records prior to " & Dt & " have been removed"

seems to work fine for me.

S
 
Back
Top