Solved

Inputbox syntax problem

Posted on 2012-12-20
1
283 Views
Last Modified: 2012-12-20
What is wrong with this code?

    If DSum("[Qty]", "tblFinGoods", "[PartN] = '" & Me.txtPart_No & "'") > 0 Then
        txtAppliedInvQty = InputBox("Excess inventory exists for this part number. Qty = " & DSum("[Qty]", "tblFinGoods", "[PartN] = '" & Me.txtPart_No & "'") - DSum("[AppliedInvQty]", "tblOpenOrders", "[PartN] = '" & Me.txtPart_No & "'", [Complete] = False) & ".  Enter the qty you want to apply to this order:")
    End If

Everything was good until I added the -DSum part.
0
Comment
Question by:SteveL13
1 Comment
 
LVL 47

Accepted Solution

by:
Dale Fye (Access MVP) earned 500 total points
Comment Utility
The "-DSUM()" part you mention has too many parameters; there should only be three.  My guess is that you want:

-DSum("[AppliedInvQty]", "tblOpenOrders", "[PartN] = '" & Me.txtPart_No & "' AND [Complete] = 0")
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

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…
Experts-Exchange is a great place to come for help with solutions for your database issues, and many problems are resolved within minutes of being posted.  Others take a little more time and effort and often providing a sample database is very helpf…
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
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…

744 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

14 Experts available now in Live!

Get 1:1 Help Now