>vfp 3.0 win 98
>
>Hello All,
>
>Trying to automatically generate new invoice number
>with a separate field that shows a,b,c etc.
>
>Came across the ASC() COMMAND and example
>but can't get it to work properly in this situation.
>
>Any thoughts? Thanks and have a great day!
>
>Becky
Maybe something like this will help...
Assuming that you can locate the last letter used, store it to cLastLtr, then
cNextLtr=iif(empty(cLastLtr),"A",CHR(ASC(cLastLtr)+1))
should return...
"A" if cLastLtr is " "
"B" if cLastLtr is "A",ect...
You will probably need to include a validation routine to hande cases where cLastLtr="Z" or any other non alpha character.
HTH
//:^)