DCount Expression needed for Formual?

D

Dave Elliott

I have a main form with 2 sub-forms on it that is used to calculate the
amounto Invoice a customer.
Here is my dilemna; The below code works OK with the exception of that it
DOES NOT account for more than 1 employee.
it works if there are 2 or more employees.

#1 thru 3 are all on the main form.Text Boxes that is

#1 gets it's value from the Time and Hours sub-form plus 2 other text boxes
on the main form
#2 "" " the Vendor List sub-form Times 1.3
#3 "" " Text box Amount on the main form Plus
Text330 Divided by 2

The DCount needs to come from the Time and Hours form where it uses
EmployeeID from the Employees table
In other words, if there less than 2 employee's on the Time and Hours
sub-form, then the formula needs to double.
i.e. #3 (Amount to Invoice) Text331=Nz([Amount]+[Text330],0)

How can I do this?


1.(Employee Time) Text330==NZ([Time and
Hours].[Form]![Text95]*[Text500]+[Text501],0)
2.(Material Amount) Amount==Nz([Vendor List].Form!Text18*1.3,0)
3.(Amount to Invoice) Text331==Nz([Amount]+[Text330],0)/2
 
D

Dave Elliott

Added Code: #4 (Text511)=[Time and Hours].[Form]![Text110] on main form,
this shows the count of employees on the sub-form Time and Hours, so now all
I have to do is figure out how to add this to my formula for Textbox331 and
else it show the default of formula as it is right now. Any Suggestions as
to how to do this?
In other words again, if the count of employees is over 1 then Text331 is
==Nz([Amount]+[Text330],0)/2
else; ==Nz([Amount]+[Text330],0)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Calculate Invoice Amount? 1
DCount Expression Help Needed 2
If Statement, What am I doing Wrong? 2
Can't get debug to break 1
Form refresh 2
SubTotals on Forms 7
Filter on an open form 2
"Sheet Total" #Error 1

Top