From: John W. Vinson on 20 May 2010 13:39
On Thu, 20 May 2010 09:41:01 -0700, Chiki <Chiki(a)discussions.microsoft.com>
>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 here:
- 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
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]
From: Chiki on 20 May 2010 23:25
I had built the table tblEmp with fields
Emp id -Auto Number
Emp Name- Text
Date of Joining -Date/time.
Days worked- Number
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.....
From: Chiki on 20 May 2010 23:35
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............
From: John W. Vinson on 21 May 2010 01:42
On Thu, 20 May 2010 20:35:01 -0700, Chiki <Chiki(a)discussions.microsoft.com>
>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............
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]