添加新记录时代码失败 [英] Code fails when adding new record
本文介绍了添加新记录时代码失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
您好:
我有一张表格可以让我添加新记录。在onCurrent事件中,我有:
展开 | 选择 | Wrap | 行号
解决方案
我不清楚你是什么'做的。这听起来像是:
1.你想要一个不打开的表格中的信息添加到新记录中。
2.你想打开表格到还不存在的记录。
为什么不在主表单中编写一个执行DLookUp或其他计算的函数来获取需要添加的信息创新纪录?没有理由首先打开另一个表单。
请参阅DM_Mix所基于的表/查询字段,而不是表单上的控件。
您还缺少视图与条件之间的逗号。您已为过滤条件设置了where条件。
展开 | 选择 | Wrap | 行号
我想做的是从我的表单到另一个表单获取计算字段。要做到这一点,我打开我正在使用的表格中当前记录的隐形表格。
芯片,我只是在计算中使用控件并将它们转移到新表单,但新表单上不存在相同的控件,所以我认为我会收到错误bc访问将无法找到计算中使用的控件。我认为将表单(F_MixDesign)打开为不可见会更容易。我发现的问题是,因为我关闭了表格(F_batching)并不意味着隐形表格已经关闭。我正试图找到解决这个问题的方法。
DonRayner,
我试过你的方法:展开 | 选择 | Wrap | 行号
Hello:
I have a form that allows me to add new records. In the onCurrent event, I have:
Expand|Select|Wrap|Line Numbers解决方案I''m not clear on what you''re doing. It sounds like:
1. You want information from a form that isn''t open to add to the new record.
2. You want to open the form to a record that doesn''t exist yet.
Why don''t you write a function in your main form that does a DLookUp or whatever calculation to get the information you need to add to a new record? There is no reason to open the other form in the first place.
Refer to the Table/Query field that DM_Mix is based on rather than the control on the form.
You are also missing a comma between your view and where conditions. You have the where condition set in place for the filter condition.
Expand|Select|Wrap|Line Numbers
What I want to do is get a calculated field from my form to another form. To do this, I open the invisible form on the record that is current in the form I am using.
Chip, I would just use the controls in the calculation and transfer them to the new form, however the same controls do not exist on the new form, so I think I would receive an error bc access would not be able to find the controls used in the calculation. I thought it would be easier to have the form (F_MixDesign) open as invisible. the issue that i found is that just beecause I have closed the form (F_batching) does not mean that the invisible form has closed. I am trying to find a solution to this issue.
DonRayner,
I tried your approach:Expand|Select|Wrap|Line Numbers
这篇关于添加新记录时代码失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文登录 关闭
扫码关注1秒登录发送“验证码”获取 | 15天全站免登陆