Query Total in a Message Box

gselliott

Registered User.
Local time
Today, 11:53
Joined
May 17, 2002
Messages
106
Display a Query Total in a Message Box

I have set up a simple query that gives me a grand Total of charges from one of another query. I don't need this information to be stored anywhere but i want to be able to display the total in a message box once I have exported the Invoices.

I have set up a form where the users selects the records to be exported and this is based upon another query, all I want to do is to put a test box on the form which displays the Total from my Total Query so that I can display the Total in a message box once the invoices have been exported.

Is there an easy way to do this or even just some way that i can pick up the Total directly from the query in the code so i dont have to bother about the text box on the form??

Any ideas would be appreciated.

Thanks in advance!
 
Re: Display a Query Total in a Message Box

Use DSum buit-in function.
 
Thanks that works a treat the only problem I have got now is that when the Total is displayed in the Message Box it does not display it as a Currency. This is what i have got:

Dim Tot As Currency
Tot = DSum("ReCharge", "qryExportTotal")
MsgBox "Export Total is " & Tot, vbInformation

Any Ideas?
 
Tot = CCur(DSum("ReCharge", "qryExportTotal"))
 
Tried that but still doesn't show the Total as Currency it is displayed as 556.6545 instead of £556.65.

Thanks again.
 
Has the textbox you are displaying this in had its Format property set to Currency?
 
Yes the text box is set to currency but the Text Box is displaying the Total correctly it just wont display it as Currency in the Message Box.
 
Code:
MsgBox "Export Total is " & Format(Tot,"£0.00"), vbInformation
:D
 

Users who are viewing this thread

Back
Top Bottom