Solved

How embed a calculation in a message box?

Posted on 2011-03-10
2
326 Views
Last Modified: 2013-11-05
I have a calculation..  DSum("[Qty]", "tblFinGoods", "[PartN] = '" & Me.txtPart_No & "'") in an after update event of a field combobox.  I want the result of this DSum calculation to be embeded in a message box..     Kind of like...

"You have 000 parts in stock".   (The "000" is the calculation from the DSum.)

How can I do this?

0
Comment
Question by:SteveL13
2 Comments
 
LVL 119

Accepted Solution

by:
Rey Obrero earned 250 total points
Comment Utility
dim vSum

vSum=DSum("[Qty]", "tblFinGoods", "[PartN] = '" & Me.txtPart_No & "'")

msgbox "You have " & vSum & " parts in stock".
0
 
LVL 75

Assisted Solution

by:DatabaseMX (Joe Anderson - Access MVP)
DatabaseMX (Joe Anderson - Access MVP) earned 250 total points
Comment Utility


Dim x as Single

x =  DSum("[Qty]", "tblFinGoods", "[PartN] = '" & Me.txtPart_No & "'")

Msgbox "You have " & x & " parts in stock"

mx
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
ust html in ms/access WebBrowswer 11 40
Display multiple images in report 12 81
How calculate median 5 37
Search field on a form 7 12
Most if not all databases provide tools to filter data; even simple mail-merge programs might offer basic filtering capabilities. This is so important that, although Access has many built-in features to help the user in this task, developers often n…
In Debugging – Part 1, you learned the basics of the debugging process. You learned how to avoid bugs, as well as how to utilize the Immediate window in the debugging process. This article takes things to the next level by showing you how you can us…
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now