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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Should I use Dmax?

Status
Not open for further replies.

fiber0pti

ISP
Nov 22, 2000
96
US
I have 3 fields. CatID SubCatID and ProdID. In a form I have a text box that I want to show me the highest value of the ProdID where the CatID and SubCatID are the same to the record that I'm looking at. Is Dmax the right function for this? I don't quite understand the help in access for this function nor have I got it to work.
 
DMax could be suitable, yes. Although any domain aggregate function can slow performance somewhat. You can apply multiple criteria to any of the domain aggregate functions:

=DMax("[FieldToReturn]", "TableOrQueryName", "[FirstCriteriaFieldName] = " & [FirstCriteria] & " And [SecondCriteriaFieldName] = " & [SecondCriteria])

Replace your actual field and table names for the place holders given.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top