******************************************************************** * Description.......: TableMaint.Add_Post_Hook * Calling Samples...: * Parameter List....: * Created by........: * Modified by.......: Nadya Nosonovsky 06/20/2000 12:44:40 PM ******************************************************************** local lcOrder, lcNewCode, lcGrdSource, lnFieldLen lcOrder=order() if !empty(filter()) wait window nowait 'The filter is now turning off in order to add...' set filter to && Turn off the filter endif if !empty(m.lcOrder) and !empty(for(tagno(m.lcOrder))) && Filtered index wait window nowait 'The filtered index is now turning off in order to add...' set order to && Filtered indexes cause problems in add mode thisform.navstand.lstOrders.enable() && Update lstOrders endif lcGrdSource=thisform.grdTable.RecordSource if type('['+m.lcGrdSource+".code"+']')="C" select max(code) from (m.lcGrdSource) into array laArr lnFieldLen=len(laArr[1])-1 lcNewCode=iif(m.lnFieldLen>0,left(laArr[1],m.lnFieldLen),"")+chr(asc(right(laArr[1],1))+1) replace code with m.lcNewCode endifIOW, I pre-populate the code with the next code in sequence. It works.