在循环过程中通过SQL生成自动PO编号 [英] Generating Automatic PO Numbers via SQL within Loop Procedures

查看:81
本文介绍了在循环过程中通过SQL生成自动PO编号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有这个代码,我认为是完美的可能有点乱,但它的工作原理。唯一的问题是第一个!PONo没有正确查看表格并生成一个连续的数字,我很好,但我更喜欢它填写表格中最后一条记录的空白和进位数。最后一个问题是,将这个PONo分配给循环过程中的相关记录有时会起作用,然后就不行了。这是代码:

Hi I have this code which i thought was perfect maybe a bit of a mess but it works. The only problem is that the rst!PONo does not look at the table properly and generate a continuing number, which i fine but i would prefer it to fill in the blanks plus carryon from the last record in the table. Also the last problem is that assigning this PONo to relevant records within a loop procedures works sometimes and then doesn''t. Here is the code:

展开 | 选择 | Wrap | 行号

推荐答案

对于计数器问题我有三条记录在pordhdr编号9,10和11中所以下一个PONo应该是12但是它是116.计数器确实加1'并且我创建了这么多记录但是已经快速删除了,有没有办法解决如果代码失败,它会填充空白并取消pordhdr编号。这样就不会浪费未使用的podrhdr编号。
For the counter problem i have three records within the pordhdr numbering 9, 10 and 11 so the next PONo should be 12 however it is 116. The counter does add in 1''s and i have created this many records however rapid deletions have been made, is there a way to solve this code so it fills in the blanks and cancels the pordhdr number if the code fails. This way an unused podrhdr number is not wasted.


我猜测PONo是一个设置为自动编号的字段。


我无法看到其他方式可以工作,但我不相信任何人会在不提及整个情况最重要的一点的情况下提出这个问题。


你能否确认在我继续之前拒绝这个,所以我知道我正在处理什么。
I''m guessing from this that PONo is a field set up as an AutoNumber.

I can see no other way for this to work, yet I can''t believe anyone would ask this question without mentioning the most important point of the whole situation.

Can you confirm / deny this before I continue so I know what I''m dealing with.


对不起,这是一个自动编号
Yeah sorry, it is an AutoNumber


这篇关于在循环过程中通过SQL生成自动PO编号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆