Solved

Another syntax issue with DSum

Posted on 2013-12-02
1
265 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
1 Comment
 
LVL 61

Accepted Solution

by:
mbizup earned 500 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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

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…
QuickBooks® has a great invoice interface that we were happy with for a while but that changed in 2001 through no fault of Intuit®. Our industry's unit names are dictated by RUS: the Rural Utilities Services division of USDA. Contracts contain un…
Familiarize people with the process of utilizing SQL Server views from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Access…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

708 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

15 Experts available now in Live!

Get 1:1 Help Now