从MsgBox返回到Form Stalling [英] Return from MsgBox to Form Stalling

查看:76
本文介绍了从MsgBox返回到Form Stalling的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

首先,提前感谢所提供的任何帮助!我在Microsoft Access 2007中使用由不再与公司合作开发的数据库。


我正在处理的数据库是为使用特定SKU /标识号输入的部件而设计的,并且在单独的计算机上运行。最初的开发人员为SKU号码设定了一个起点,但它的使用已经超出了原来的意图。我被要求在表单中添加代码,以便可以在每台计算机上设置一个范围,以防止在将数据编译到中央计算机时出现重复。我输入了以下代码来设置范围和功能但是一旦满足范围,你必须单击okay按钮16次才能返回到表格。任何帮助将不胜感激。

First, thanks in advance for any assistance given! I''m working in Microsoft Access 2007 on a data base developed by someone no longer with the company.

The database I''m working on is designed for parts to be entered with a specific SKU/Identification number and is running on seperate computers. The original developer set a starting point for the SKU number that works but its usage has grown beyond its original intentions. I was asked to add code into the form so a range could be set on each computer as to prevent duplicates when the data is compiled to a central computer. I entered the following code which sets up the range and functions but once the range is met you have to click the okay button 16 times to return to the form. Any help would be greatly appreciated.

展开 | 选择 | Wrap | 行号

推荐答案

我认为你不喜欢没有一个网络驱动器可以设置一个后端文件?


只是通过查看你的代码,我不能说你为什么需要点击OK按钮16次退出对话框。但是,我可以建议一些能让你的代码更符合良好实践的东西,也许可以解决你的问题。


我首先会在文本框中使用BeforeUpdate事件这是取SKU号码;第二,我会在参数中编写带有更多细节的DCount()调用,并实际使用调用条件的第三个参数。例如,假设表中的文本框名称为 txtSKU ,字段名称为 fldSKU

I take it that you don''t have a network drive on which to setup a single back end file?

Just by looking at your code, I can''t really say why you need to click the OK button 16 times to get out of the dialog box. However, I can suggest a couple of things that will bring your code more in line with good practice and might perhaps fix your problem.

I would first use the BeforeUpdate event for the text box that is taking the SKU number in; second, I would write the DCount( ) call with more specifics in the arguments, and actually use the third argument which calls for criteria. So for instance, assuming a text box name of txtSKU, and a field name of fldSKU in the table:

展开 | 选择 | Wrap | 行号


感谢Pat。数据库正在不同位置的笔记本电脑上运行,他们正在寻找的是每台计算机上的1000个范围。我道歉,因为我的代码设置为1个概率错过了你,(我保持一个较低的数字,所以不必键入,但一条记录进行测试)。


谢谢,

Joe
Thanks Pat. The databases is being run on laptops at different locations and what they are looking for is a range of 1000 on each computer. I apologize as my having the code set to 1 probabply miss led you, (I was keeping a low number so not to have to key in but one record to test).

Thanks,
Joe


大家好!

希望我明白你的问题。

所以,我认为您可以使用表单的LOAD事件来检查是否有记录。如果是,则将允许添加属性设置为

您还可以设计一个标签,您可以通知用户最大记录数到达。
Hi all !
Hope I understand OK your problem.
So, I think you can use the LOAD event of the form to check if there is a record. If YES then set the Allow Additions property to No.
Also you can design a label where you can inform the user that maximum numbers of records is reached.


这篇关于从MsgBox返回到Form Stalling的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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