>Help. I am fairly new to VFP so I'm having trouble figuring out how to do some things. I have a table where JOB_NO is a field and primary key.
>
>On a form, when a user enters a job_no, I want it to check then whether this is a new job no.
>
>My thinking is this should be done in the Valid of the table for job_no. I just don't know how to check to see if its a unique number without moving the record pointer which causes a recursive error.
>
>I cannot generate the job_no on the form or with the default value because it is keyed from a hard copy, and I don't know what the next value will be.
>
>Any help/suggestions is greatly appreciated
>
>Phil
lcAlias = alias()
select jobno from mytable where mytable.jobno = this.value into cursor temp
if _tally > 1 && another record w/ number
=messagebox('This number already used')
endif
use in temp
select &lcAlias