Solved

DSum syntax problem

Posted on 2014-02-04
4
263 Views
Last Modified: 2014-02-04
I'm trying to do a DSum using this control source but it isn't working.  What would the correct syntax be?

=DSum("[ReadyQty]","tblReady","[TextMNumber] = " & [Forms]![frmPlanted]![cboTextMnumber.Column(0)])
0
Comment
Question by:SteveL13
  • 2
4 Comments
 

Author Comment

by:SteveL13
ID: 39832487
Note:

cboTextMnumber.Column(0)]) is a text field.
0
 
LVL 143

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 500 total points
ID: 39832585
=DSum("[ReadyQty]","tblReady","[TextMNumber] = " char(34) & [Forms]![frmPlanted]![cboTextMnumber.Column(0)] & char(34) )
0
 
LVL 61

Expert Comment

by:mbizup
ID: 39832587
=DSum("ReadyQty","tblReady","TextMNumber = " & Forms!frmPlanted!cboTextMnumber.Column(0))

Open in new window


You don't need all the square brackets, but your syntax actually looked good.  Double check field names
0
 
LVL 61

Expert Comment

by:mbizup
ID: 39832595
-->>> cboTextMnumber.Column(0)]) is a text field.

Whoops - Guy is correct.  You need quotes.

But his Char(34) should be Chr(34)    -- no points please.
0

Featured Post

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

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

When you are entering numbers in a speadsheet, and don't remember what 6×7 is, you just type “=6*7" instead. It works in every cell! This is not so in Access. To enter the elusive 42 in a text box, you have to find a calculator, and then copy the re…
As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
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.
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

856 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