表已通过用户界面打开,无法以编程方式进行操作 [英] Table already open through user interface and cannot be manipulated programmatically

查看:42
本文介绍了表已通过用户界面打开,无法以编程方式进行操作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我有一个表格,它使用表''病人'作为记录来源并输入动态名称。我有一个8位数的文本ID字段,以PT开头(PT000001)。我编写了以下代码以获取新记录的下一个最大ID。

Hi,
I have a form which uses table ''Patients'' as Record Source and type Dynaset. I have a 8 digit text id field which starts with ''PT'' (PT000001). I wrote the following code to get the next maximum ID on a new record.

展开 | 选择 | Wrap | 行号

推荐答案

发生错误的是哪一行?您可以通过在sub的第一个可执行行上设置断点然后逐步执行它来找到它,直到出现错误。


此外,您的ID的格式究竟是什么值?也许你可以给我们一个简短的例子清单。谢谢。


Pat
What line is the error occurring on? You can find this out by setting a break point on the first executable line of the sub then stepping through it until the error is raised.

Also, what exactly is the format of your ID values? Maybe you could give us a short list of examples. Thanks.

Pat


Pat,

错误发生在第12行。
Pat,
The error occurs at line 12.
展开 | 选择 | Wrap | 行号


我打算建议以某种形式使用DMax。 DMax是处理此问题的常用方法。这并不是说SELECT TOP不能工作......但是你可以看到它的缺点是需要使用记录集。


所以你的情况得到解决然后?


Pat
I was going to suggest using DMax in some form. DMax is the usual way of handling this problem. This is not to say that SELECT TOP can''t work...but as you can see it has the disadvantage of needing to use a recordset.

So your situation is resolved then?

Pat


这篇关于表已通过用户界面打开,无法以编程方式进行操作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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