修复DMax自动递增数字的差距 [英] Fix Gap in DMax auto incremented numbers

查看:87
本文介绍了修复DMax自动递增数字的差距的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有这段代码

I have this code

展开 | 选择 | Wrap | 行号

推荐答案

DMax将给出最大值。


要做你想做的事,你需要一个标志来说明这个数字是手动添加的,你的DMax表达式必​​须排除标记的数字。


这是非常狡猾的,我强烈反对。

当你的上一个自动号码是8041并且手动添加8042时会发生什么?


一个可能的解决方案,提供号码设置为无重复tes是从8000开始递增数字,当检测到重复时,添加1并再试一次。这需要VBA代码


也不是那么喜欢。


Phil
DMax will give the maximum value.

To do what you want, you need a flag to say that the number has been added manually and your DMax expression must exclude the flagged numbers.

This is extremely dodgy and I strongly advise against.
What happens when your last automatic number is 8041 and 8042 has been added manually?

A possible solution, providing the number is set up as no duplicates is to increment the numbers starting at 8000, and when a duplicate is detected, add 1 and try again. That would require VBA code

Don''t really like that either.

Phil


现在有多个值,系统可以自问这个条目是否有一定值?是的,表中有几个字段,如果这些条目是手动输入的话,它会说手动输入。那么是否有VBA代码允许我在DMax代码中标记这些条目?


因为我不在乎数字是否重复我只是需要它按顺序排列是全部。
Right now there are multiple values that the system could ask itself does this entry have a certain value? And yes it does there are several fields within the table that if these entries are entered in manually it will say "MANUAL ENTRY". So is there VBA code that will allow me to flag these entries that say that within the DMax code?

Because I don''t care if the number duplicates or not I just need it to go in proper sequence is all.


如果我理解正确,如果序列中存在差距,那么这将自动指示手动输入,而不是标记 '需要手动输入。如果这是真的那么你可以简单地从表格中的最后一个记录开始,向上导航到达第一个差距。高于此Gap + 1的数字将是原始序列中的下一个数字。 DMax()甚至不会进入图片。
If I am understanding you correctly, if there is a Gap in the sequence, then this would automatically indicate a manual entry, and no ''flagging'' of manual entries would be required. If this is true then you could simply start from the last Record in the Table, navigate upwards to you reach the first Gap. The number above this Gap + 1 would be the next number in the original sequence. DMax() would not even enter into the picture.


这篇关于修复DMax自动递增数字的差距的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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