Dmax problem

S

S.Dickson

I am trying to use DMax("WarrantyClaimID", "tblWarranty") + 1 to
produce the warranty Claim Number

It work fine until by working out the number until it has to generate
11 as it just alwasy seems to put 10.

Even if i manualy change it to 11 then save it and try it again it
should put 12 but instead it puts 10 there again even thought it have
alread been use.


Any one help me with y it will not work out numbers larger than 10

Thanks
 
A

Allen Browne

If you open tblWarranty in design view, what is the Data Type of
WarrantyClaimID? Number or Text?

Assuming Number, try:
CLng(Nz(DMax("WarrantyClaimID", "tblWarranty"), 0)) + 1
 
S

S.Dickson

tblWarranty is a linked table tomysql server, Im not sure if its text
or Number

This is all new to me
Im trying to learn access and mysql
 
D

David F Cox

My guess is text - sorts 1,10,2,3,...9
9 will still be "max". You need to convert it and sort numeric as suggested
 
Top