edit1.text:='(数据库中最后一个记录的'’KHBH‘')'+‘00001'结果:(数据库中最后一个记录的'KHBH')00001

解决方案 »

  1.   

    在edit1的change
    事件里加上判断语句来实现
    if   eof   then
    edit1.text:=   + '00001'
      

  2.   

    edit1.text:=query1.fieldbyname('KHBH').value+'1001';
      

  3.   

    怎样寻最后一个记录+‘00001’,显示格式为‘XXXXX’五位
      

  4.   

    TQUERY中的最后一条记录可不是表中的最后一个记录呀!
      

  5.   

    table1.Last;
    edit1.text:='0000'+inttostr(strtoint(query1.fieldbyname('KHBH').value)+1);
      

  6.   

    var tem:integer;
        s:string;
    tem:=strtoint(字段);//先把字段换成数据
    tem:=tem+1;
    if tem<10 then
       s:='0000'+inttostr(tem)
     else
       if tem<100 then
          s:='000'+inttostr(tem)
         else
            if tem<1000 then
               s:='00'+inttostr(tem)
             else
               if tem<1000 then
                  s:='0'+intostr(tem)  
               if tem<10000 then
                  s:=inttostr(tem);
    query.edit;
    query.fieldbyname('字段').asstring:=s;
    query.post;