473,396 Members | 1,975 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,396 software developers and data experts.

DSum in Form based on Date and Name

I have a Split form called 'EodF' with employee names and their expenses on a particular date. I need do a Dsum for getting their total expenses in a text box based on the 'Date' in text box and their name in a combo box.
Oct 9 '15 #1
2 1314
Seth Schrock
2,965 Expert 2GB
Lets say that your textbox is named txtDate and your combo box is named cboEmployee. One thing that you don't tell us is if the combo box is bound to a the employee ID (numeric) or the employee name (text), so I'll provide both options. In your textbox in which you want the total expenses, enter one of the following:
(for numeric employee ID)
Expand|Select|Wrap|Line Numbers
  1. =DSum("ExpenseFieldName", "TableName", "EmployeeField = " & Forms!EodF!cboEmployee & " And ExpenseDateField = #" & Forms!EodF!txtDate & "#")
(For text employee name)
Expand|Select|Wrap|Line Numbers
  1. =DSum("ExpenseFieldName", "TableName", "EmployeeField = '" & Forms!EodF!cboEmployee & "' And ExpenseDateField = #" & Forms!EodF!txtDate & "#")
The difference is that text fields must have quotes around the string for which you are searching.

Just make sure to change the field names and the table name to fit what you have.
Oct 10 '15 #2
Thanks for your support ! its working fine!
Dec 9 '15 #3

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

Similar topics

3
by: Jason | last post by:
I am trying to filter records in a primary form based on records in related tables. The data in the related tables is being displayed in the primary form through subforms. To be more specific, I...
0
by: Mike | last post by:
I have a form that has a search button on it. The form has three text boxes, last name, first name, and bidder number. I put in a last name and click the search button. Clicking the search button...
13
by: david | last post by:
I can not figure out what is the problem that I can protect ASP.NEt form resource but not some other type of files, for example, images. All my aspx forms located in Demo folder and image files...
10
by: RoadRunner | last post by:
Hi, I have a employee vacation database that has a vacation table that has the employee name, pay week and date of vacation. I have another lookup table with pay week code and date range for the...
1
by: gblakewood | last post by:
Simple question (I think)... I have a form based on a table and I want it to open with it sorted on Last Name ascending. I set the order by property for the form to: tblPersonnel. ASC but it...
4
by: Deus402 | last post by:
Here is my table design: tblEmployers EmployerID autonum (primary key) EmployerName text tblLocations LocationID autonum (primary key) EmployerID longint (foreign key) LocationAdress text
5
by: SeanCly10 | last post by:
Hi all. I don't want to sound like a complete idiot here, but I'm somewhat limited in my coding knowledge, and I need some advice and help. I'm working on a database that will eventually be used...
2
by: Ulv | last post by:
I don't get it !!! Stupid, stupid, stupid I have 2 tables. TblPostings: Id, autonumber, key BlockNo, text NoofItems TblItem:
7
imrosie
by: imrosie | last post by:
Hellol, I'm again in need of your help with my Order processing system.. My Order form is based on (query) of Customer and Order tables (includes a subform for the product data)...has a listbox...
1
by: MikeMikerson | last post by:
Hello, I am need to create a subform (no problem) of a form based query (a problem). I need a form that will prompt the user to enter in a name, and the form will then display a query of the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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,...
0
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...
0
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...
0
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...

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.