* Form custom method do case case !empty(thisform.tmsTxtbox.value) ; and !empty(thisform.tecTxtbox.value) locate for TMS == trim(thisform.tmsTxtbox.value) ; and TEC == trim(thisform.tecTxtbox.value) case !empty(thisform.tmsTxtbox.value) locate for TMS == trim(thisform.tmsTxtbox.value) case !empty(thisform.tecTxtbox.value) locate for TEC == trim(thisform.tecTxtbox.value) otherwise return .f. && No data yet - return flag endcase if eof() && No match found if messagebox("Add ?")=6 insert into mytable (TMS,TEC) ; values (thisform.tmsTxtbox.value, thisform.tecTxtbox.value) else * Clear out TMS,TEC thisform.tmsTxtbox.value = "" thisform.tecTxtbox.value = "" return .f. && Return false flag for no data endif endif * You might bind controlsources if you wish * do not forget to unbind when done with save/revert etc thisform.tmsTxtbox.controlsource = "mytable.TMS" thisform.tecTxtbox.controlsource = "mytable.TEC" * Enable/disable controls return *Add could call custom form method * You may add this to save/revert button thisform.tmsTxtbox.controlsource = "" && Unbind thisform.tecTxtbox.controlsource = "" *Enable/disable controls here thisform.tmsTxtbox.setfocus()Pls note that this is only a basic skeleton.