Solved

Inputbox syntax problem

Posted on 2012-12-20
1
290 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 48

Accepted Solution

by:
Dale Fye 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

Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

Question has a verified solution.

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

Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
If you need a simple but flexible process for maintaining an audit trail of who created, edited, or deleted data from a table, or multiple tables, and you can do all of your work from within a form, this simple Audit Log will work for you.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
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…

623 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