Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Filter the data displayed on a from. 1

Status
Not open for further replies.

sheusz

Technical User
Jan 21, 2008
24
AU
Hello All,

Since joining this forum I've learnt a lot about MS Access and every question that I have asked has given me a solution. I am hoping that someone can help me with this little problem.

I have a form that displays on it the last time I visited a customer;

Code:
=DMax("[Service Date]","xServices","CustomerID='" & [CustomerID] & "'")

This works great, but what I also want to do is have the form display on it the last time I visited the customer to perform a routine service. Like this;

Last Visit: 10/01/08
Last Service: 30/11/07

The last visit my not have been for a routine service

The table xServices has a text data field called Catagory.

The Catagory field has the following Data Row Source;
"S Call";"Service";"Training";"Repairs";"Commissioning"

What code do I need in order to get it to display the last service date on the form?

Thanks in advance for your help.
 
Something like this ?
Code:
=DMax("[Service Date]","xServices","CustomerID='" & [CustomerID] & "' AND Catagory='Service'")

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Yeah! Just like that. Many thanks to you PH.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top