Forms :: DCount / 2x Criteria - Counting Family Members Under 16 Years

Jan 13, 2014

Using MS Access 2000

I'm building a customer management database. Part of which is a table to record details of all members of the main customers family or the household compliment.

I'm currently using a DCount to work out how many people on the table are related to my client, to work out the size of the family.....

=DCount("MemberID","tblHHMembers","CustID = [CustID]")+1

Could I also then count the members of the household that are under 16 years old by looking at the DoB from the same household members table?

I realise that I'd need to ask access to calculate age at the same time as working out if they're under 16 and then count them if they have the same Customer ID - which might need a little more than this single function!

View Replies


ADVERTISEMENT

Adding Payments Due For Family Members In Query.

Sep 28, 2005

Hello,

I have a query that lists members who have outstanding payments. The results of this query are being used to populate a winword mail merge document.

The problem with this query is that if there are multiple members from the same family who owe then I will get an entry for each of them in my query results. What I would like to do is add the amounts due so that I only have 1 entry for that family. Additionally, since it is possible that more than 1 person can have the same last name and not be related I would also like to have the query check the address field and if it's the same than add the amounts due. The following is the sql statement for the current query.

SELECT Members.FirstName, Members.LastName, Members.ParentsNames, Members.HomePhone, Members.PaymentDue, Members.Active, Members.MemberDues, Members.FamilyAmount
FROM Members INNER JOIN MemberTypes ON Members.MemberTypeID = MemberTypes.MemberTypeID
WHERE (((Members.PaymentDue)=Yes) AND ((Members.Active)=Yes))
ORDER BY Members.LastName;

Any assistance would be greatly appreciated.

Regards,
Chris

View 4 Replies View Related

Counting Years Between Dates

Jan 25, 2006

Friends,

I have a form with four fields, date1, date2, date3 and date 4.
These have all a mm/dd/yyyy format.
I need to add an unbound control which will count in months and years the difference between the dates.

Ex.
date1: 01/01/1970
date2: 05/05/1980

date3: 06/06/1990
date4: 06/30/2001

Fields date3 and date4 may be blank, therefore the code should consider only counting the first two.

Thanks for any help.

View 14 Replies View Related

Forms :: DCount Function With Combobox Criteria

Oct 7, 2014

I am working with MS Access 2003. I have a form (frmCalendar) with a textbox (tbDay) and a combobox (cmbLineName)

I want to count the number of records based on the criteria from cmbLineName, and show the result in tbDate. Inside the Control Source of tbDate I put in the following:

=DCount("[EncounterID]","tblEncounters","[LineName] = ' " & "Forms![frmCalendar]![cmbLineName] = " ' ")

The problem is that the result in tbDate is always 0; regardless of what is chosen in cmbLineName. I know that the record count should not be 0 for all criteria.

View 4 Replies View Related

Forms :: DCount In Textbox On Form Greater Than 5 Criteria

Mar 14, 2013

I have a textbox on a form. I am using

Code: =DCount("*","suspend_time_lapse",[Days from Target to Planned End dates]>5)

as the text box source. I get name? or error no matter what i do.

I want to count all records in the [suspend_time_lapse] table where [Days from Target to Planned End dates] is greater than 5.

View 4 Replies View Related

Modules & VBA :: DCount Function Counting 0s As 1s

Sep 24, 2013

In my database when an item is currently being loaned the item's loaned field will have a 1 to indicate this. When the item is returned the value is 0. Only so many items are available and when I use the DCount function it is counting the 0s as 1s.

View 1 Replies View Related

Forms :: Counting In Forms When Meeting Criteria

Feb 23, 2014

I have created a form that list the hours that people do for different types of activities. What I want to do is to sum the hours of each activity. However, I have some activities that I want to group.

For example, I have Training, Ride Outs and Mentor as types of activities that I want to group and then there are all other types that I want to group as Other.

I would just like to add a formula into the command box of properties.

View 2 Replies View Related

Queries :: Parameter Query Criteria To Return Dates With 2 Years Remaining

Sep 17, 2013

I am trying to create a parameter query to return dates that have 2 years remaining.

For example I have dates for when mortgages expire, and I want to recognise the dates that have two years remaining using a parameter query but I can't figure out if I use DateAdd or DateDiff.

View 2 Replies View Related

Dcount With Multiple Criteria

May 16, 2005

Not sure if this belonged in reports or queries, so I chose general. I have looked at several DCount threads but haven't quite found my answer. I want to use Dcount in an unbound textbox in a report. It counts the number of records in another table - comparison
the first part of the statement works fine ( up to 'iss'"). When i added the between date part i'm not getting any # returned in my report. I want to addthe criteria of RecDate between the 2 dates on the open form.
Can anyone tell me where my problem lies? ( if this makes sense)

Thanks
Kevin


=DCount("[type]","comparison","[type] Like 'iss*'" And ("[comparison].[RecDate]" Between Forms!DateInputforRMAsReturned!Text0 And Forms!DateInputforRMAsReturned!Text2))

View 14 Replies View Related

Queries :: DCount Against Two Criteria

Nov 5, 2013

I am looking to create a summery on a dataset. I have

Employee ID Duration
1234..............10
1234..............20
1234..............8
1234..............9
1236..............40
1236..............2
1236..............20
1236..............10

I want to summerise the data to calculate the number of times an employee has an entry under 20 and the calculation. e.g.

Employee ID....Count.....Sum
1234...............3...........27
1236...............2...........12

I used a DCount however this does not separate the employees. Currently using
Count Of Visits: DCount("[Duration]","Test Query","[Duration]<20 AND [Employee ID] = [Employee ID]")

View 1 Replies View Related

Modules & VBA :: Getting Age In Years With One Decimal Place (3.5 Years)

Mar 24, 2014

I have a table that lists computers I want to know the age of them for replacement purposes. I am using this function to populate a textbox on a form that updates my table. the results I am getting is a negative whole number I would like to get a positive number with one decimal place. so if computer was shipped September 24, 2010 my textbox would say 3.5 not -3

Here is my function

Code:
Private Sub Form_Load()
Dim theDate As Date
Dim age As Integer
theDate = Nz(Me.compDate.value, 0)
If theDate > 0 Then
age = DateDiff("yyyy", Now(), theDate)
Me.compAge = age
End If
End Sub

View 4 Replies View Related

Forms :: Delete Inactive Members?

Jan 9, 2015

I have created a database containing customer records and i wanted to somehow add a part where an individuals records will automatically be deleted if they are not active for 3 years+

View 6 Replies View Related

General :: DCount Under Condition With Two Criteria

Jun 26, 2015

I have a field named Poisition_Id and a yes/no field with the name Hired, what i want is dcount under condition initially with Position_ID to Position_ID then to see the field of hired if "yes"

Example:

=dcount "a" see in tbl_open with criteria position_id = position_id with criteria hired=yes

I am unable to write this formula..

View 1 Replies View Related

Modules & VBA :: DCOUNT With Date Criteria

Feb 3, 2014

I can't get the following DCOUNT working for the life of me: DCount("EmployeeName", "tblAttendance", "EmployeeName = '" & cboEmployee Name. Value & "'" And "AttendanceDate = #" & txtAttendanceDate.Value & "#")I have checked this forum along with Google and there seems to be no easy way to do this? I have tried editing the syntax over and over again. I have been able to run a query and get the desired result in that query; however I am unable to call that result in VBA.

View 7 Replies View Related

Dcount For 2 Criteria Date Fields?

Apr 19, 2014

With a form with two fields one is a date field formatted as short date and the other is a lookup combo box that I use to lookup predefined times and is formatted as short time. The date and time are stored in the same table as date/time in separate fields. I attempted to use Dcount, and get syntax error missing operator. Below is one of a hundred that i have tried after scouring this forum and the net. I ended up converting the Appt_Time field to a text field in the table to eliminate one date field but still got no where.

Code:
Private Sub Appt_Time_BeforeUpdate(Cancel As Integer)
'Check table for duplicate
If DCount("[Appt_Time]", "tblexams", "Appt_Time= & Appt_Time & And [Sch_Date] = #" & Sch_Date & "#") > 0 Then
'Message box warning of duplication

[Code] ....

View 4 Replies View Related

Dcount With Filter Criteria On A Related Table?

Aug 25, 2014

Code:

DCount("*","[tblLeaveRequests]","Status='Approved' And #" & Format([vDate1],"mm/dd/yyyy") & "# BETWEEN [LeaveStartDate] AND [LeaveEndDate]")

The above code counts all leave with the status of approved on the table [tblLeaveRequests]. Great, but i did forget a critera.

Of the leave it is counting, I want it to only count if the employee the leave is for is in a particular location. which exists on the related table, and not the one dcount is calling.

Is this possible? or will i have to resort to replicated data in [tblLeaveRequests]

View 3 Replies View Related

Modules & VBA :: DCount With Multiple Type Criteria And With Cmb Source

Jul 19, 2015

The following code is giving me a "Run-Time error '13' Type mismatch. I have tried isolating both criteria and they seem to be fine but joined together with "AND" they error. Workdate is a Shortdate. Flightnumber and flightID are numbers. FlightID source is a cmb within my form.

Private Sub FlightID_BeforeUpdate(Cancel As Integer)

If DCount("[WorkDate]", "Main_tbl", "[WorkDate]= #" & Me.WorkDate & "#" And "[FlightNumber] =" & Me.FlightID.Column(0)) > 0 Then
Do this....
End If

View 1 Replies View Related

Queries :: Expression DCOUNT With Last Month Date Criteria

Feb 8, 2015

I am trying to count the amount of records that were created and closed for last month but I am having problems inserting the correct criteria along with the DCOUNT syntax. DCount("*","obsvnofilterqry","(Date_Closed)=MONTH( Date())").Works fine but figuring out how to get the amount of Date_Closed for last month is proving tricky.

View 11 Replies View Related

How To Create Family Relationships?

Aug 23, 2005

I am building a DB for a nonprofit, and trying to figure out how to create a family relationship for contacts. Basically, it will be for mailing- so they receive only one, and to record donations.

At times, John and Mary Smith will donate together, and sometimes John Smith will donate in conjuction with an organization.

So, I would like the family relationship to be with John and Mary Smith, but also would like to be able to track that John Smith, but not Mary, is a member of that particular organization.

I would like the donations that John & Mary make together to show up in both their records, but the donations that John makes with an organization to show only in his record and the organization record.

Is this possible to create in access? I'm a bit stumped at this point.

View 1 Replies View Related

General :: Count Number Of Records Based On Certain Criteria Using DCount

Jun 5, 2014

I have a report that I am trying to complete based on several queries. I am trying to count the number of records based on certain criteria and using the following DCount.

=DCount("[Calculated time]","IPG1","[Calculated Time] <= 0.04" And [Ship-to party] In ("SN00207PJZ","SN09162XXX","SN09324XXX"))

I want to count the number of IPG1 records that are under .04 and have the Ship-to party of the ones listed. I have tried everything that I can think of to get it to work but can's seem to get it to. I figure it's something easy but I don't see it.

View 4 Replies View Related

Forms :: Format Memo Field To User Specification - RichTextBox Members Not Found?

Mar 16, 2015

I have a pop up window that maximizes and the need to format a Memo Field to users specification.

Unfortunately the Mini Popup Bar that comes up when you select text is very shy and annoying when it doesn't show up. It's Completely Unreliable.

So I thought I'll make the Controls on the form for Bold,Italic... etc but I can't seem to get the code to work.

My TextField is a Memo and I have changed the TextFormat to RichText, but I cannot use any of the commands like .SelBold or .SelColor etc.. It gives me a Compile Error: Member or Data Member Not found.

I don't understand why? Is there a Add In/Reference that I need to include?

View 2 Replies View Related

Reports :: Counting Records According To Assigned Criteria

Oct 24, 2014

I am trying to use =DCount() on a report and its half way working, it does count records acording to the criteria I asign the problem is its using the whole universe of records in the table so I have a report displaying 10 records of which 953 are Red and 752 are Blue...

View 14 Replies View Related

Forms :: Continuous Form With Textfields As Records - List Of Years With Totals Of Hours

Jul 1, 2015

I have a continious form with textfields as records. Its about total course hours that are calculated. There is a field in the records that holds and calculates the hourse that one have done and another field that holds the max hours they may follow for one year.

Every record has h different year.

When the amount of hours in the transmission textfield is negative, they can transmit the hours to te next year. Therefore i have to calculate the Max hours per Year + the transmission hours.

So the calculation is not a problem. Though i don't actually know where i can trigger the calculation. I have tried it with a button on the form, but then the user always have to click to see the right amount of hours for the next year. That's not handy. I am looking for a way to automatically calculate the field Max hours per year. Given that the Max hours per year is a bound field, its bound to a table where i stock the Max hours that i have calculated.

I also tried it with the button that's used for inserting new course hours, but then it calculates with the old values instead of the new ones.

How can i trigger the calculation automatically without using a button.

View 1 Replies View Related

Forms :: DCount In Forms To Avoid Duplicate Record

May 31, 2014

How can I prevent duplicate records from being added from a form, the dcount in the text field property, trigged before update is where this should be used is what I know but having trouble with the syntax.

I've got the table tblInvnetoryDetail with InvID(AutoNumber), and SerialNumber. The form text field is txtSerialNumber. I've managed this far with the expression

DCount([InvID],"tblinventoryDetail","[txtSerialNumber]=&"'") but this did not work.

How can I get the expression to avoid duplicates.

View 4 Replies View Related

Dcount In Forms For Entries Only..

Aug 4, 2005

Hi All,

basically i'm new to access, i am not a programmer and have been asked (told) to do an access (a few) for our office,

OK what I have is a very very simple database, we add in the post that we post out every day. I have two fields called Postage Paid and Stamp Required. I have used a Dcount to count how many have Postage Paid and how many require a stamp (Stamp Required).

What I want is to add the totals for the day that i enter them, i don't need to store that data, just to tally up the totals for the day i enter them...

View 1 Replies View Related

Forms :: DCount From Two Tables

Dec 7, 2014

In my form, i would like to sum and dispay the values of datas from two different tables.

Table1: MasterTable1
Table2: MasterTable2

I use the below code for one table and its working.

Text15 = DCount("[client]", "[MasterTable1]", "[Confirmed]=Yes and [Assigned]=No")

But i want to sum the same criteria from MAstertable1 & Mastertable2 and display the data.

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved