473,386 Members | 1,828 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Working With DatePart and Check Box as criteria for DCOUNT

Hello all!

I have a table that is used to track custoemr visits that contains the following fields: [Customer Name] [Date of Visit] [Location] [Topic] [SAFC Rep] and [Visit Completed?]. [Visit Completed is a check box using the Yes/No Format, and the [Date of Visit] field uses the simple mm/dd/yyyy format.

On a form I have created, I would like to use the DCOUNT function to return the number of Customer visits that have been completed during the current year. So if the [Visit Completed?] box is checked, and the yyyy for [Date of Visit] falls during the current year I would like it to be counted. Any ideas on how to code the unbound text box?

Thanks!
Nov 14 '12 #1

✓ answered by Rabbit

You can use True for checked. And you can use the Year() function to return just the year part of a date.

2 1564
Rabbit
12,516 Expert Mod 8TB
You can use True for checked. And you can use the Year() function to return just the year part of a date.
Nov 14 '12 #2
NeoPa
32,556 Expert Mod 16PB
Produce a procedure (We'll call it X for now) that checks the values of [Visit Completed?] and [Date of Visit] and determines the value for the number of qualifying visits to populate some TextBox or other on your form.

Next, call this procedure from all three of :
  1. The Form_Current() event procedure.
  2. The Visit_Completed__AfterUpdate() event procedure.
  3. The Date_of_Visit_AfterUpdate() event procedure.
Nov 15 '12 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: Mike Conklin | last post by:
This one really has me going. Probably something silly. I'm using dcount for a report to determine the number of different types of tests proctored in a semester. My report is based on a...
2
by: Samaba via AccessMonster.com | last post by:
I need to create a calculated control which will count the number of cases if the is "open" and the is "a" for a calendar quarter. I have been struggling with which formula would work best:...
3
by: BerkshireGuy | last post by:
I am having difficulty with using the Dcount function. I am trying to return the number of records from qryIndividualFeedbackDetail where the TimelyManner field is set to 4. So, in the new...
2
by: ChasW | last post by:
Greetings, I have a form that uses a query as its record source. In the form I have a text box that uses this as its control source: =DCount("", "qry_Search_by_Name") The DCount function...
14
by: Ørjan Langbakk | last post by:
I have a form where the user has the possibility to enclose his name. email, address and phonenumber. I want to be able to check if some of the fields are filled - at least one. This is so that...
3
by: psuaudi | last post by:
I am trying to use the following code, but I think there is an error in my syntax: Count = DCount("", "Change Dates", " = '" & !! & "' AND CVDate(Int( #" & & "# )) = #" & (Date) & "#") I...
2
by: Annie | last post by:
Hello guys, I have set the MEMBERSHIP, ROLEMANAGER and PROFILE in my config file as below. I just want to use my own sql server 2000 table instead of MSDB.
2
by: =?Utf-8?B?Umljaw==?= | last post by:
I am looking for some suggestions from the group on Source Safe. 1. What is the best practice/rule for the Source Safe to check-out and check-in files for a small group of developers? 2. ...
1
by: akirekab | last post by:
I am using DCount, but I am not able to find how to set simple multiple criteria. Here is sample of what i need. =DCount("PatientProfileID","qryFaceToFaceReason_EAP_VG","FaceToFaceReasonID=2"...
12
doma23
by: doma23 | last post by:
Hi, I have the following code that doesn't work: DCount("*", "", _ "((='" & Form_frmMain.cmbField1 & "') AND (" & "='" & Form_frmMain.cmbField2 & "') AND (" & "='" &...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.