Update:
DMax encounted a problem when the digits increased.
DMax worked fine for....
Code:
ID (note: this datatype is short text)
1001
1001A
1002
1003
1004
1004A
1004B
DMax = "1004B" (note: use a left or right function in VBA to trim to just "1004")
However, when the table was....
Code:
ID
50000 (Note: For some reason Access puts the largest numerical data type at the top of the table - even a simple sort query does not fix this)
1001
1002
1003
1004
1004A
1004B
DMax = "1004B" (This is a problem)
So, i remedied the issue with creating a query with two fields. The first field is, of course, ID, the second field is an expression which converts the ID to just the numeric portion. The expression is "Sorted: Val([ID])".
So, the query datasheet looks like...
Code:
ID Sorted
50000 50000 (this value is STILL at the top regardless of sorting my ascending order....)
1001 1001
1002 ....
1003 ....
1004 ....
1004A 1004
1004B 1004
Now that the "sorted" query column/field exists, the DMAX will return as...
As it should!
A lot of work and messing around for something so simple. .. Hopefully this helps someone. Note: the VAL function will not work for format of A1234, and will only work for 1234A, where the alphabetical characters are the SUFFIX. Val(A1234) will return null or 0.