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

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 want to know what the last ProdID was for the CatID AND the SubCatID. How do I do this? Do I use Dmax? and how do I use it?
To sum it up I want to look up the highest # in the ProdID field for the CatID and SubCatID. I hope this makes since. I just want it to display it in a text field in a form.
 
Set the RecordSource property of your control equal to the following statement (obviously modify for your environment):

=DMax("[ProdID]","TableWithYourProdIDs","[txtCatID]=[CatID] AND [txtSubCatID]=[SubCatID]")

I didn't test this, but I've used similar things before in my forms.

Joe
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top