View Full Version : Messagebox help


craigcain
09-26-2007, 05:31 AM
I am trying to add an expression into a messagebox but I am not sure how to make access view it as an expression instead of as text (I am new at using the expression builder)

=MsgBox("The current severity rate is: @ «Expr» Reports![File name]![No of Lost Days].RunningSum «Expr» @ ",64,"Severity Rate")

I am sure that i am probably way off with the actual expression as well but I can look at that afterwards. Thanks in advance for any help.

KenHigg
09-26-2007, 05:41 AM
Are you trying to put the value of this control:

Reports![File name]![No of Lost Days].RunningSum

In a message box text?

If so, maybe something like:

dim tStr as string

tStr = "Some Text " & Reports![File name]![No of Lost Days].RunningSum & " Some more text"

msgbox tStr, 64,"Severity Rate"

???

ken

craigcain
09-26-2007, 05:49 AM
Yes I am trying to get the value of the running total and display it in the messagebox. Ill try doing it like in your example. Thanks for the help

craigcain
09-26-2007, 06:59 AM
Thanks again it is now working. A problem that I still have though is that the file I am taking the data from needs to be open otherwise I get an error. Is there a way to open an access report in the following code somewhere?

Dim tStr As String

tStr = "The current severity rate is: " & Reports![File name]![No of Lost Days].RunningSum & " "

MsgBox tStr, 64, "Severity Rate"

Craig