Here is the standard way of approaching this problem
Re: Primary Keys Thread #
441081 Message #
441087>Help. . . I have a little table which provides the next barcode number but I can't stop getting a duplicate number over the network. Sometimes when two or more people are using the system and generating new barcodes, we get duplicate numbers. Here is my barcode numbrs code :
>
>
>local nBarc
>select barcno
>nBarc=barcno.barcno
>IF nBarc <= 0
> MESSAGEBOX("This computer is not setup with barcode numbers","")
> RETURN
>ENDIF
>replace barcno with nBarc+1
>FLUSH in barcno force
>IF USED("barcno")
> USE IN barcno
>ENDIF
>IF NOT USED("barcno")
> SELECT 0
> USE barcno
>
>endif
>
>
>Any quick fixes ???
>Cheers. Shafid
If it's not broken, fix it until it is.
My Blog