LOCAL lcSql lcSql = [SELECT count(*) as present from ] + p_table + [ where ] + p_field + [ = ?p_data] l_result = SQLEXEC(p_connection, lcSql)>Hello Sergey !
>valid event of field in form >*********************************** >p_data = alltrim(this.value) >p_table = "t_adressen" >p_field = "name1" >if p_cancel = .F. && no mouseclick on abort button so do the valid !! >return (p_exists(p_table,p_field,p_data)) >endif >********************************************* > >in my functions.prg i have it like this > >function p_exists >parameters p_table,p_field,p_data c>if present = 0 >return 1 >else >return 0 >endif > >endfunc>