按保存的时候
会出现这个这个
但是实际上数据时输进去了
看了下,应该是这边错掉输入表后的操作
bitbtn2.OnClick(sender); //调用取消按钮清空记录
Form19.getspbh(sender); //得到下一单据编号
Edit2.Text:=spbh; //显示编号值
procedure TForm19.getspbh(sender:Tobject); //得到销售单编号
begin
adoquery1.Last;
if adoquery1.RecordCount=0 then
spbh:=formatdatetime('yyyymmdd',datetimepicker1.Date)+'XS'+formatfloat('0000000',1)
else
spbh:=formatdatetime('yyyymmdd',datetimepicker1.Date)+'XS'+formatfloat('0000000',strtoint(copy(adoquery1.Fields[1].asstring,13,7))+1);
end;
我分不多
麻烦大家给我看下吧
会出现这个这个
但是实际上数据时输进去了
看了下,应该是这边错掉输入表后的操作
bitbtn2.OnClick(sender); //调用取消按钮清空记录
Form19.getspbh(sender); //得到下一单据编号
Edit2.Text:=spbh; //显示编号值
procedure TForm19.getspbh(sender:Tobject); //得到销售单编号
begin
adoquery1.Last;
if adoquery1.RecordCount=0 then
spbh:=formatdatetime('yyyymmdd',datetimepicker1.Date)+'XS'+formatfloat('0000000',1)
else
spbh:=formatdatetime('yyyymmdd',datetimepicker1.Date)+'XS'+formatfloat('0000000',strtoint(copy(adoquery1.Fields[1].asstring,13,7))+1);
end;
我分不多
麻烦大家给我看下吧
你先判断一下这个值是不是整型再做运算就可以了。
说 not enough catual parameters呢
如果是数字你在处理别的东西
我不怎么会哎
发现还是不行
var
i: Integer;
begin
if TryStrToInt('123', i) then
begin
ShowMessage('是数字 ' + IntToStr(i));
end
else begin
ShowMessage('不是数字');
end;
end;
begin
adoquery1.Last;
if adoquery1.RecordCount=0 then
spbh:=formatdatetime('yyyymmdd',datetimepicker1.Date)+'XS'+formatfloat('0000000',1)
else
spbh:=formatdatetime('yyyymmdd',datetimepicker1.Date)+'XS'+formatfloat('0000000',strtointdef(copy(adoquery1.Fields[1].asstring,13,7),0)+1);
end;
应该是这个不够长,然后copy过来的是空串,然后转换成int出错
不一定用trystrtoint自己直接包个try except不就ok了,错误的时候日志输出以下,看看数据是不是不符合预期的