473,587 Members | 2,225 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

DCount function

I'm having difficulty with the DCount function, not getting the
results that I want.
Field1A and Field2A are fields in TableA matching Field1B and Field2B
in TableB

Using a calculated control in a subform bound to TableB, Field1B and
Field2B are on the form. (Control names are txtField1B and txtField2B)
= DCount("ID", "TableA", "([TableA].[date]=date() AND
[TableA].[Field2A]=[TableB].[Field1B] AND
[TableA].[Field2A]=[TableB].[Field2B])")

I have tried this also using the reference to the controls on the form
as well, but still no good:

= DCount("ID", "TableA", "[TableA].[date]=date() AND
[TableA].[Field1A]=forms!frmSubfo rm1!txtField1B AND
[TableA].[Field2A]=forms!frmSubfo rm1!txtField2B" )

What am I doing wrong ? Thanks in advance for any help.
Nov 13 '05 #1
1 1847
Sh**********@Ki dNet.com wrote:
I'm having difficulty with the DCount function, not getting the
results that I want.
Field1A and Field2A are fields in TableA matching Field1B and Field2B
in TableB

Using a calculated control in a subform bound to TableB, Field1B and
Field2B are on the form. (Control names are txtField1B and txtField2B)
= DCount("ID", "TableA", "([TableA].[date]=date() AND
[TableA].[Field2A]=[TableB].[Field1B] AND
[TableA].[Field2A]=[TableB].[Field2B])")

I have tried this also using the reference to the controls on the form
as well, but still no good:

= DCount("ID", "TableA", "[TableA].[date]=date() AND
[TableA].[Field1A]=forms!frmSubfo rm1!txtField1B AND
[TableA].[Field2A]=forms!frmSubfo rm1!txtField2B" )

What am I doing wrong ? Thanks in advance for any help.


Perhaps your [date] column contains more than just a date? (i.e. the
time part too).
--
[OO=00=OO]
Nov 13 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
5565
by: jdph40 | last post by:
I posted this problem previously and received excellent help from Wayne Morgan. However, I still have an unanswered question. My form (frmVacationWeeks) is opened from the OnClick event of a button on another form (frmEmpList) which has a list box that contains the names of all employees. When a name is selected in the list box and the...
1
2826
by: Megan | last post by:
Hi Everybody- I've been reading some of the posts about DCOUNT, and I haven't yet found an answer; so, I'm posting this question. I have a report that I'm trying to use DCOUNT on to compute the percentages of each group. The groups are based on sports. For instance, football, soccer, baseball, basketball. I have a table of people that...
4
7535
by: Will | last post by:
Hi, I had a DCount within a module on records in a table where CustSuffix = 0. I now need to DCount where CustSuffix = 0 and the type of cost Suffix (Suffix in table) = G. I can't get both requirements to work and have tried a number of different formats. At the moment I am getting an object required error message. This is the current...
6
3312
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 parameter query which is the recordsource for the report. The parameter is <=. The query returns the correct amounts upto the date entered (no need for...
3
3320
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 query I am trying the following: NumOfYes: Dcount(,"qryIndividualFeedbackDetail",=4) The query is counting ALL of the timely manners and is...
2
12254
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 works properly with the query until I add a criteria to the query like this:
2
7935
by: Wingz | last post by:
Hiya, Fairly new to Access and was wondering what the best way to perform Dcounts on groups in an Access report. For example, I have 10 employees and the different instances of jobs they can perform are either Clean, Shampoo or Vacuum. I have a query called Details that shows a history of all the jobs they have performed. On my report I want...
36
11405
by: bmyers | last post by:
Good afternoon, I am attempting to count only those records within a report, which is based on a query, where Status is equal to Closed. I have tried multiple variations of DCOUNT but am continuously receiving the "#ERROR" message in the control source box on the report. Below is the expression that I have tried to use and modify numerous...
8
2291
by: Susan Bricker | last post by:
I have used DCount() to determine the number of records in a recordset. Silly me ... I just noticed that DCount returns an INTEGER, which can hold a maximum value of 32,767. What if the recordset recordcount exceeds 32,767? Is there a different function that returns a LONG datatype (which can hold a value upto 2,147,483,647)? Regards,...
1
1820
iBasho
by: iBasho | last post by:
Hi I am using the DCount function to check and alert users for existing IDs in my database after a new record is entered. ..Private Sub CARDID_AfterUpdate() If DCount("*", "", " = '" & Me. & "'") Then MsgBox "This card ID number already exists in the system. Once you enter the dependent code you will be able to determine if this is a...
0
7915
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7843
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
1
7967
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
8220
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5712
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5392
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3872
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1452
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1185
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.