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

Search Multiple Fields and Generate Next Available number

Status
Not open for further replies.

wrightlefty

Technical User
Feb 19, 2004
17
US
I have three different fields; series, identifier, and partcode (ex. sss-iippp). I want to type in the series and identifier into combo boxes and then click a button that will search the series and identifier fields for all partcodes associated with the inputed data. Then it should find the highest numbered partcode, add 1, combine the 3 fields into one number (format sss-iippp), and place the new number in a field called newpartnum. I'm not sure if this should be done with queries, macros, or just written completely in VB. I would say I am a beginner, so any and all ideas would be welcome. Thanks.
 
Have a look at the DMax function.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
The dmax function will work at the end to find the highest partcode and add 1, but how do I search the series and identifier fields and find only the highest value partcode associated with the inputed data?
 
And what about the 3rd argument of the DMax function ?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Thanks. The DMax worked great. No queries necessary, one line of code did it all. Thanks again.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top