Sep 3, 2002 #1 sabavno Programmer Joined Jul 25, 2002 Messages 381 Location CA Hi I have a table called 'CONFIGURATION' that has a numeric 'ModelID' field. How would I lookup the max value of that field from the vba code? Thanks
Hi I have a table called 'CONFIGURATION' that has a numeric 'ModelID' field. How would I lookup the max value of that field from the vba code? Thanks
Sep 3, 2002 #2 KenReay Programmer Joined Aug 15, 2002 Messages 5,424 Location GB Hi You could use dMax() See help for syntax, or you could use a recordset based on select statement ordered by ModuleId Desc then read the first row. Regards Ken Reay Freelance Solutions Developer Boldon Information Systems Ltd UK kenneth.reay@talk21.com Upvote 0 Downvote
Hi You could use dMax() See help for syntax, or you could use a recordset based on select statement ordered by ModuleId Desc then read the first row. Regards Ken Reay Freelance Solutions Developer Boldon Information Systems Ltd UK kenneth.reay@talk21.com
Sep 3, 2002 #3 rgbanse MIS Joined Jun 4, 2001 Messages 211 Location US Sabavno, Give this a try Function FindMaxValue() Dim MaxValue As String MaxValue = DLookup("Max([FieldName])", "TableName" MsgBox MaxValue End Function RGB Upvote 0 Downvote
Sabavno, Give this a try Function FindMaxValue() Dim MaxValue As String MaxValue = DLookup("Max([FieldName])", "TableName" MsgBox MaxValue End Function RGB