如何在 Access 2007 中使用 vb 更新子表单中的记录集(我收到错误 #3426)
我正在尝试更新子窗体中的控件。 其实我是在计算月份数。 这是代码:(不起作用!)
While (Not Me.Form.Recordset.EOF)
months = Round((Me.End - Me.Start) / 30, 0)
Form_FinanceSubform.[number of months] = 0
Me.[number of months] = months
Me.Form.Recordset.MoveNext
Wend
我得到的错误是:“此操作已被关联对象取消” 在 Me.Form.Recordset.MoveNext 线上
有人可以帮我吗? 谢谢!
I am trying to update a control in a subform.
Actually I am calculating the number of months.
here is the code: (which doesn't work!)
While (Not Me.Form.Recordset.EOF)
months = Round((Me.End - Me.Start) / 30, 0)
Form_FinanceSubform.[number of months] = 0
Me.[number of months] = months
Me.Form.Recordset.MoveNext
Wend
the error i get is: "this action was cancelled by an associated object"
on the line Me.Form.Recordset.MoveNext
could someone please help me out here??
thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
只需将这部分代码放入表单的 BeforeUpdate 事件中即可:
我确实认为您可以将代码缩短为:
Just put this part of your code in the form's BeforeUpdate event:
I do think you could shorten your code to this: