DMax + 1

livvie

Registered User.
Local time
Today, 19:31
Joined
May 7, 2004
Messages
158
I am having a problem with a counter that uses DMAX + 1 to get the number. It works fine until it reaches 10 and then it stays at 10 from there on ? Heres the code.
MyLineNo = DMax("line", "tblnquote_d", "id=" & MyId) + 1
 
Should this be:

MyLineNo = DMax("[line]", "tblnquote_d", "[id]=" & MyId) + 1

or does it matter?

ken
 
livvie said:
Heres the code.
MyLineNo = DMax("line", "tblnquote_d", "id=" & MyId) + 1

Nothing wrong with it so what other code do you have around it?
 
On a side note: MMax might be better for you ^_^ talk to Mile-O-Phile for that one.
 
'tblnquote_d' is a table, and line is a number, not string? Right?

ken
 
Had another look at datatypes and []'s etc and I have it solved now thanks.
 
Last edited:
I had exactly the same problem and after a lot of head scratching spotted that the table field was set to text not number , quite why it works for single digit numbers I dont know
 
Text Sort

Strings from "1" to "10" ascending will sort as follows:
1, 10, 2, 3, 4, 5, 6, 7, 8, 9
So adding one to the max keeps giving you a "10"
 

Users who are viewing this thread

Back
Top Bottom