D
Dave
SO I click a button on a form and it takes the data in a field on that form
and puts it in a table, not related to that form.
Thanks
and puts it in a table, not related to that form.
Thanks
It is clear what you want for the final result, Here is aSometimes my explanation of my needs does not convey enough
for anyone to help
My apologies.
I think this is probably really easy - if I could just explain
myself better.
"tblCustomers"
has all my customer info plus a field for "LastOrderDate"
(Meaning the Last
time they placed an order)
"refLastOrderDate"
is a single row table where the admin can limit how long a
customer list is
getting by entering a date that he wishes to have no customers
listed who have not ordered since that time
my query to open the form "frmCustomerList " filters great
based upon the above 2 objects
HOWEVER there is currently no way to enter the "LastOrderDate"
in "tblCustomers"
"tblOrders" has a field called "OrderDate" which when an order
form ("frmOrders")opens is populated with todays date.
When I close (Print Preview) "frmOrders" I want that OrderDate
(Todays date) to populate the field "LastOrderDate" in
"tblCustomers" FOR THAT CUSTOMER so that the filter will work.
I hope that is more clear on my needs
Thanks for your patience
Dave
Bob,
Thanks for the reply.
This approach looks like it might solve some other issues I am
having with this
but I am not sure how/where you want me to use it.
dave
Bob Quintal said:It is clear what you want for the final result, Here is a
different way to obtain the list of Current customers, that
does not need the last order date as a field in the table.
The query uses a calculated field
LastOrderDate: (SELECT max(OrderDate FROM Orders WHERE
Orders.CustomerID = Customers.CustomerID)
Put your filter in the Criteria row for this calculated
field.
Bob Quintal said:Bob,
Thanks for the reply.
This approach looks like it might solve some other issues I am
having with this
but I am not sure how/where you want me to use it.
dave
Here's a little more detail. Open the query you said you use as
the report source. Bring down the fields you want but instead of
bringing down the LastOrderDate, you place the following
expression in the field name box
LastOrderDate: (SELECT max(OrderDate) FROM Orders WHERE
Orders.CustomerID = Customers.CustomerID)
That sets up a subquery that gets the last order date for that
customer and puts it into the row.
HTH
Jeff Boyce said:If that "calculated field" is in the query, not in a table, then yes.
Regards
Jeff Boyce
Microsoft Office/Access MVP