I use the following to obtain last bill no from a dbf
sele Bill_book
set order to 1 // index on str(bill_no,7) to bill_1
set filt to bill_no = mbill_no
go bott
store bill_no + 1 to mbill_no
set filt to
Now when I call the save routine, I check for duplicate bill_no :-
Do Case
Case choice = "S"
sele bill_book
seek str(mbill_no,7)
if Found()
Alert("Sorry Can't Save, Duplicate !!!"
.....
Else
Save_Data()
.....
endif
EndCase
....
....
But sometime ( I don't know how ) program assigns duplicate bill_no and overwrite previous (same) bill No.
When our a/c deptt. reports two bills having same bill no it looks...
Is there any other reason for this?
Please help and suggest the best way to assign unique no.
Thanks.
sele Bill_book
set order to 1 // index on str(bill_no,7) to bill_1
set filt to bill_no = mbill_no
go bott
store bill_no + 1 to mbill_no
set filt to
Now when I call the save routine, I check for duplicate bill_no :-
Do Case
Case choice = "S"
sele bill_book
seek str(mbill_no,7)
if Found()
Alert("Sorry Can't Save, Duplicate !!!"
.....
Else
Save_Data()
.....
endif
EndCase
....
....
But sometime ( I don't know how ) program assigns duplicate bill_no and overwrite previous (same) bill No.
When our a/c deptt. reports two bills having same bill no it looks...
Is there any other reason for this?
Please help and suggest the best way to assign unique no.
Thanks.