Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Another syntax issue with DSum

Posted on 2013-12-02
1
Medium Priority
?
325 Views
Last Modified: 2013-12-02
What is wrong with this:

Me.txtLeadFromEdPend = Nz(DSum("[Agent Sale $ Commission]", "tblTransactions", "[ListingAgent] = " & Forms!frmSelectDateRangeAndMembers!txtMemberName & " And [PendingMonth] = " & Forms!frmSelectDateRangeAndMembers!txtMonth & " And [PendingYear] = " & Forms!frmSelectDateRangeAndMembers!txtYear & " And [Pending] = True" And [LeadFrom] = "Ed"), 0)

Note:  "LeadFrom" is a text field.
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 61

Accepted Solution

by:
mbizup earned 2000 total points
ID: 39690222
Try this:

Me.txtLeadFromEdPend = Nz(DSum("[Agent Sale $ Commission]", "tblTransactions", "[ListingAgent] = " & Forms!frmSelectDateRangeAndMembers!txtMemberName & " And [PendingMonth] = " & Forms!frmSelectDateRangeAndMembers!txtMonth & " And [PendingYear] = " & Forms!frmSelectDateRangeAndMembers!txtYear & " And [Pending] = True And [LeadFrom] = 'Ed'"), 0)

Open in new window


(The Ed, since it is a string constant needs to be embedded in the SQL string using ' as delimiters)
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
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…

618 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