Solved

Combination criteria for unbound field on a report

Posted on 2015-01-19
5
160 Views
Last Modified: 2015-01-19
What is wrong with this syntax?

= DCount("[AwardedClient]", "tblClientGeneral", "[AwardedClient]= True") AND "[AwardedDate]" = Between Forms!frmSelectDateRange.txtStart and Forms!frmSelectDateRange.txtEnd

I'm trying to count the number of Trues in a table within a date range specified on an open form.

--Steve
0
Comment
Question by:SteveL13
  • 2
  • 2
5 Comments
 
LVL 50

Expert Comment

by:Gustav Brock
ID: 40558566
It should be something like this:

=DCount("[AwardedClient]", "tblClientGeneral", "[AwardedClient]= True And [AwardedDate] Between DateValue(" & Forms!frmSelectDateRange.txtStart & ") And DateValue(" & Forms!frmSelectDateRange.txtEnd & ")")

/gustav
0
 
LVL 24

Assisted Solution

by:Phillip Burton
Phillip Burton earned 250 total points
ID: 40558568
= DCount("[AwardedClient]", "tblClientGeneral", "[AwardedClient]= True AND [AwardedDate] Between " & Forms!frmSelectDateRange.txtStart & " and " & Forms!frmSelectDateRange.txtEnd)

Assuming that the dates are in date format. May need #s around the dates as well, as in #01/02/2014#
0
 

Author Comment

by:SteveL13
ID: 40558605
I have to change this and will issue a new request if needed.  The form is NOT going to be open so I have to use the report criteria something like:  (which is not working)

=DCount("[AwardedClient]", "tblClientGeneral", "[AwardedClient]= True And [AwardedDate] Between DateValue(" & Reports!rptImportAnalytics.txtWeekstartingdate & ") And DateValue(" & Reports!rptImportAnalytics.txtWeekstartingdate & ")+7")
0
 
LVL 50

Accepted Solution

by:
Gustav Brock earned 250 total points
ID: 40558648
Question is if the fields holds a value. Try first:

=DateValue(" & Reports!rptImportAnalytics.txtWeekstartingdate & ")

or simply:

=DateValue([txtWeekstartingdate])

/gustav
0
 

Author Closing Comment

by:SteveL13
ID: 40558657
Awarded to both of you because I changed the rules mid-stream.
0

Featured Post

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

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

Introduction The Visual Basic for Applications (VBA) language is at the heart of every application that you write. It is your key to taking Access beyond the world of wizards into a world where anything is possible. This article introduces you to…
It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

685 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