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

function in VBA to find largest value in record

Status
Not open for further replies.

Guest_imported

New member
Joined
Jan 1, 1970
Messages
0
Hi all,

i have a table call "customer orders" and in this table, there is a field that should be auto-assigned number and i want to use VB code to do (it's not autoID, because i only need this field some time, not everytime, and i already have autoID for the primary key).

I guess i have to first check throught all the record for the largest existing number, and then plus by 1 and assign it as the next number. how do i do that?

Cheers
Sam
 
DMax("FieldName", "TableName")

Regards,

Dan
[pipe]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top