Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 295
  • Last Modified:

Inputbox syntax problem

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
SteveL13
Asked:
SteveL13
1 Solution
 
Dale FyeCommented:
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

Get your Conversational Ransomware Defense e‑book

This e-book gives you an insight into the ransomware threat and reviews the fundamentals of top-notch ransomware preparedness and recovery. To help you protect yourself and your organization. The initial infection may be inevitable, so the best protection is to be fully prepared.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now