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
  #1  
Old May 19th, 2010, 04:56 AM posted to microsoft.public.access.forms
Chiki
external usenet poster
 
Posts: 22
Default Sum & Count on Form.

i had a form on which i had created a combo box that contain several employees.

I want the amount earned (Currency Format) by each employee to be displayed
on the formin the text box.

Other fields in my table are;

Empid,Empname,amount earned.etccc

please tell me how to solve this.
  #2  
Old May 19th, 2010, 05:31 AM posted to microsoft.public.access.forms
Chiki
external usenet poster
 
Posts: 22
Default Sum & Count on Form.

I mean i want the sum to be displayed in the text box whenever i select an
employee from the combo box.
  #3  
Old May 19th, 2010, 05:47 AM posted to microsoft.public.access.forms
John W. Vinson
external usenet poster
 
Posts: 18,261
Default Sum & Count on Form.

On Tue, 18 May 2010 20:56:01 -0700, Chiki
wrote:

i had a form on which i had created a combo box that contain several employees.

I want the amount earned (Currency Format) by each employee to be displayed
on the formin the text box.

Other fields in my table are;

Empid,Empname,amount earned.etccc

please tell me how to solve this.


Well, it's a bit hard to be sure given the sparse information, but try setting
the control source of the textbox to

=DSum("[Amount Earned]", "tablename", "[EmpID] = " & [EmpID])

--

John W. Vinson [MVP]
  #4  
Old May 19th, 2010, 11:47 AM posted to microsoft.public.access.forms
Chiki
external usenet poster
 
Posts: 22
Default Sum & Count on Form.

Is it so difficult???

Please tell me what other information do i need to provide

Thanks
  #5  
Old May 19th, 2010, 09:24 PM posted to microsoft.public.access.forms
John W. Vinson
external usenet poster
 
Posts: 18,261
Default Sum & Count on Form.

On Wed, 19 May 2010 03:47:01 -0700, Chiki
wrote:

Is it so difficult???

Please tell me what other information do i need to provide

Thanks


Did you see my previous answer?

try setting the control source of the textbox to

=DSum("[Amount Earned]", "tablename", "[EmpID] = " & [EmpID])

--

John W. Vinson [MVP]
  #6  
Old May 20th, 2010, 03:51 AM posted to microsoft.public.access.forms
Chiki
external usenet poster
 
Posts: 22
Default Sum & Count on Form.

Yes, i had tried using the formula u had given.

Its returning an #Error Message.I dont know why.I think i had to check out
the exact syntax or check the correct text box names.

Thanks.
  #7  
Old May 20th, 2010, 06:13 AM posted to microsoft.public.access.forms
John W. Vinson
external usenet poster
 
Posts: 18,261
Default Sum & Count on Form.

On Wed, 19 May 2010 19:51:01 -0700, Chiki
wrote:

Yes, i had tried using the formula u had given.

Its returning an #Error Message.I dont know why.I think i had to check out
the exact syntax or check the correct text box names.

Thanks.


Well... yes.

I cannot see your screen. I do not know the name of your table; you should use
it in place of "tablename". Likewise you need to specify the correct
fieldnames... which, again, I do not know.

If you'll post some more details about your table (table name, fieldnames,
datatypes of those fields, form control names) someone should be able to help.
--

John W. Vinson [MVP]
  #8  
Old May 20th, 2010, 08:26 AM posted to microsoft.public.access.forms
Chiki
external usenet poster
 
Posts: 22
Default Sum & Count on Form.

Ok.Sorry if i had missed anything.

I had created a table named EMP. The Table consists of the fields:-

Emp id-Autonumber
Employee Name-Text
Date of Joining-Date/time
Days worked-Number
Amount Earned-Currency.

On the form,i had created the combo box named:Employee Name

and text boxes named;Date of Joining,amt earned & Days worked.

Please tell me now what to change in my code;


  #9  
Old May 20th, 2010, 04:20 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 00:26:01 -0700, Chiki
wrote:

Ok.Sorry if i had missed anything.

I had created a table named EMP. The Table consists of the fields:-

Emp id-Autonumber
Employee Name-Text
Date of Joining-Date/time
Days worked-Number
Amount Earned-Currency.

On the form,i had created the combo box named:Employee Name

and text boxes named;Date of Joining,amt earned & Days worked.

Please tell me now what to change in my code;


Set the Control Source property of the textbox [amt earned] to

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

This assumes (again, perhaps incorrectly, I don't know) that the Employee Name
combo box is displaying a name but has the Emp ID as its control source and
bound column.
--

John W. Vinson [MVP]
  #10  
Old May 20th, 2010, 05:41 PM posted to microsoft.public.access.forms
Chiki
external usenet poster
 
Posts: 22
Default Sum & Count on Form.

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.
 




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 08:39 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.