Link to home
Start Free TrialLog in
Avatar of jonsuns7
jonsuns7

asked on

MS Access 2007 - Want Variable to display in Message Box

I have some simple code In which I want a variable to display in a message box.

Even though I copied some sample code it still does not work.

Here is the code:

Dim LValue As String

LValue =  Now

MsgBox  "The current Time is: " & LValue & " Have a Good Day"

Note: This uses a Now function to put a time value into the variable. Also, I have tried to put regular string text into the variable and that doesn¿t display either.

Thanks for any help.
ASKER CERTIFIED SOLUTION
Avatar of DatabaseMX (Joe Anderson - Former Microsoft Access MVP)
DatabaseMX (Joe Anderson - Former Microsoft Access MVP)
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of jonsuns7
jonsuns7

ASKER

Nope still no luck. Something seems to be preventing the variables from showing up. No matter what variables I try, string, integer
In the VBA editor ... Menu >> Debug >> Compile .... are there any errors ?

mx
Something else is going on ... works for me - see image.

mx
Capture1.gif
<No points wanted>
I'm with MX...

Dim LValue As Date
LValue =  Now
MsgBox  "The current Time is: " & LValue & " Have a Good Day"

...works fine for me


Perhaps you should state exactly what "Does" appear when you run the code...

Is this an issue in all forms?, for all users?, in all databases?