Hi,
There are multiple ways that you could go about this. Using domain
aggregate functions as the data source for the controls would likely be the
most simple, assuming that the sales info is in a table with the related
employee id.
For instance, for the most current sale amount, if you know the latest sale
date (air code so watch for typos & substitute your acutual field/control
names):
=DLookup("[YourSaleAmtField]","YourTableName","EmployeeID =" &
YourFormEmployeeIDControl & " AND SaleDate = #" & YourFormSaleDateControl &
"#")
Note that in the previous, you could also use DMax() to return the max sales
date if it wasn't avail on the form.
For the current months sales:
=DSum("[YourSaleAmtField]","YourTableName","EmployeeID =" &
YourFormEmployeeIDControl & " AND SaleDate >= #" &
DateSerial(Year(Date()),Month(Date()),1) & "#")
Year to date sales would be the same, but the month part of the dateserial
would be replaced with a 1.
Another way to get the values that you want would be to construct sql
statements in VBA and read the values from recordsets opened using them, but
the domain aggregate functions should be much simpler.
HTH, Ted Allen
> Help - I want to return the following values in a form:
>
[quoted text clipped - 16 lines]
>
> Thanks in advance.
Ted,
I appreciate your help but I am still having problems.
I am really getting frustrated with myself - I have forgotten way too much
about Access (and programming in general).
I used the DSum function you suggested and I don't receive an error message
but I also don't receive any data - I just don't know where to go at this
point.
Cyndi
> Help - I want to return the following values in a form:
>
[quoted text clipped - 16 lines]
>
> Thanks in advance.