Solved

Inputbox syntax problem

Posted on 2012-12-20
1
288 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
ID: 38709850
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

Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The first two articles in this short series — Using a Criteria Form to Filter Records (http://www.experts-exchange.com/A_6069.html) and Building a Custom Filter (http://www.experts-exchange.com/A_6070.html) — discuss in some detail how a form can be…
As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
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…

828 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