A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Sum & Count on Form.



 
 
Thread Tools Display Modes
  #11  
Old May 20th, 2010, 06:39 PM posted to microsoft.public.access.forms
John W. Vinson
external usenet poster
 
Posts: 18,261
Default Sum & Count on Form.

On Thu, 20 May 2010 09:41:01 -0700, Chiki
wrote:

I did not get u..How could i use the Control source of Employee Name as EMP Id.

I could not understand the syntax also.


Please open the form in design view.

Select the Employees combo box.

View its Properties.

Post the following properties to a message he

- Rowsource (where the combo box gets its information) - post the SQL view if
it is a query
- Control Source (where it puts the data when you select a row)
- Bound Column (which field from the rowsource it stores in the control
source)

The syntax of DSum is that it takes three text strings as arguments. The first
text string is the field that it sums; the second is the name of the table or
query containing the field; the third is an optional criterion specifying
which records to sum. So

=DSum("[Amount Earned]", "[EMP]", "[Emp id] = " & [Employee Name])

means look in the table EMP; select those records where the [Emp id] field is
equal to the value contained in the form control named [Employee name] - which
I'm hoping is the employee ID; and when you find those records, sum up the
numbers in the field named [Amount Earned] and return that sum as the result
of the function.
--

John W. Vinson [MVP]
  #12  
Old May 21st, 2010, 04:25 AM posted to microsoft.public.access.forms
Chiki
external usenet poster
 
Posts: 22
Default Sum & Count on Form.

Ok then.

I had built the table tblEmp with fields

Emp id -Auto Number
Emp Name- Text
Date of Joining -Date/time.
Days worked- Number
Amount earned-Currency

Regarding the

RowSource:i had created a SQL Query name qryemp,where the query returned
only the Employees name from tblemp

Control Source:=DSum("[Amount Earned]","[EMP]","[Emp id] = " & [Emp Name])

Bound Column:not sure which column i should refer 2/5.

Also , please tell me ,can i upload the file to your reference.

Thanks in advance.....




  #13  
Old May 21st, 2010, 04:35 AM posted to microsoft.public.access.forms
Chiki
external usenet poster
 
Posts: 22
Default Sum & Count on Form.

I had followed all the steps you had told me.

Applied the same Control source property of the text box (amount Earned)

still getting ERRORS............
  #14  
Old May 21st, 2010, 06:42 AM posted to microsoft.public.access.forms
John W. Vinson
external usenet poster
 
Posts: 18,261
Default Sum & Count on Form.

On Thu, 20 May 2010 20:35:01 -0700, Chiki
wrote:

I had followed all the steps you had told me.

Applied the same Control source property of the text box (amount Earned)

still getting ERRORS............


Chiki...

My crystal ball is very foggy tonight.

I cannot see your database.

You have not been communicating.

Please post (as requested!) the names AND DATATYPES of the fields involved.
Please post (as requested!) your actual code.
Please post the actual text of your error message.
--

John W. Vinson [MVP]
 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 09:57 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.