Solved

Inputbox syntax problem

Posted on 2012-12-20
1
285 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

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

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

I originally created this report in Crystal Reports 2008 where there is an option to underlay sections. I initially came across the problem in Access Reports where I was unable to run my border lines down through the entire page as I was using the P…
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 retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.

910 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

16 Experts available now in Live!

Get 1:1 Help Now