记录集 [英] RecordsetClone

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

问题描述

我已将Access 97数据库转换为Access 2003


以下代码现在失败并返回运行时错误''3420''


Dim rst作为DAO.recordset

设置rst = Forms!frm1!frm2.Form.RecordsetClone


我已经安装了Access的最新更新和Jet

我检查过参考文献并且它们没问题

我已禁用沙盒模式

我已将数据库导入一个新的外壳


我已经运行以下作为测试


Dim rst作为DAO.recordset

Set rst = Forms!frm1.RecordsetClone

设置rst = Forms!frm1!frm2.Form.RecordsetClone


代码定义更高级别的表单''frm1' '记录集​​但未能

定义子表单''frm2''记录集,其中包含''对象invaild或没有

更长的设置''错误

这开始让我疯狂,我真的很高兴来自开明群众的任何

帮助

I have converted an Access 97 database to Access 2003

The following code now fails and returns Run-time error ''3420''

Dim rst as DAO.recordset
Set rst = Forms!frm1!frm2.Form.RecordsetClone

I have installed the latest updates to Access and Jet
I have checked the references and they are fine
I have disabled the ''Sandbox'' mode
I have imported the database into a new shell

I have run the following as a test

Dim rst as DAO.recordset
Set rst = Forms!frm1.RecordsetClone
Set rst = Forms!frm1!frm2.Form.RecordsetClone

The code defines the higher level forms ''frm1'' recordset but fails to
define the subforms ''frm2'' recordset with the ''Object invaild or no
longer set'' error

This is starting to drive me insane and I would really appreaciate any
help from the enlightened masses

推荐答案

d。******* @ orcf.co.nz 写道:
d.*******@orcf.co.nz wrote:

Dim rst作为DAO.recordset

Set rst = Forms!frm1!frm2.Form.RecordsetClone
Dim rst as DAO.recordset
Set rst = Forms!frm1!frm2.Form.RecordsetClone



假设frm2是名字作为子表单的表单。

不要使用该名称,使用子表单的名称。因此,如果frm1有一个名为sub1的

子表单作为其源对象frm2,那么你可以像这样引用




表格!frm1.sub1.form.recordsetclone


有些人根本不会使用刘海,这有效:


表格。 frm1.sub1.form.recordsetclone


这在Access 97中是相同的,BTW。


-

Tim http://www.ucs.mun.ca/~tmarshal/

^ o<

/#)Burp-beep,burp-beep,burp-beep? - Quaker Jake

/ ^^小心点,大鸟! - 同上TIM-MAY !! - 我

Presumeably, frm2 is the name of the form that acts as the subform.
Don''t use that name, use the name of the subform. Thus if frm1 has a
subform named sub1 which has as its source object, frm2, then you refer
to it like this:

forms!frm1.sub1.form.recordsetclone

Some would not use the bangs at all and this works:

forms.frm1.sub1.form.recordsetclone

This was the same in Access 97, BTW.

--
Tim http://www.ucs.mun.ca/~tmarshal/
^o<
/#) "Burp-beep, burp-beep, burp-beep?" - Quaker Jake
/^^ "Be Careful, Big Bird!" - Ditto "TIM-MAY!!" - Me


蒂姆 - 谢谢你的回复,不过你的建议没什么乐趣


我又做了几次测试如果我在

中创建一个新的表单和子表单,那么现在的Access 2003 db代码可以在建立子表单的

记录集克隆时没有问题。

当我将子表单插入到新的主表单中时,代码会起作用,

因此看起来主表单在某种程度上是损坏的。


我试图将旧表单的控件复制并粘贴到新的
主表单中,但错误仍然存​​在。只有在创建了新的主表单和新控件时才能解决问题




现在的问题是主表单包含一个带有大量的选项卡控件

字段,子表单等等,并且需要永远重新创建。


之前有没有人遇到过这个问题,有什么建议吗

复制主表单而不必重新创建每个控件

包括格式化等

Tim Marshall写道:
Tim - thank you for your reply, however no joy with your suggestion

I have run a few more tests and if I create a new form and subform in
the now Access 2003 db the code has no problem establishing a
recordsetclone of the subform.

When I insert the subform into a new master form the code then works,
therefore it appears the master form is corrupt in someway.

I have tried to copy and paste the controls of the old form into a new
master form, but the error still occurs. The problem is only resolved
when a new master form and new controls are created.

The problem now is the master form contains a tab control with numerous
fields, subforms, etc and would take forever to recreate.

Has anyone had this problem before and are there any suggestions on how
to replicate the master form without having to recreate every control
including formating, etc
Tim Marshall wrote:
< a href =mailto:d。******* @ orcf.co.nz> d。******* @ orcf.co.nz 写道:
d.*******@orcf.co.nz wrote:

Dim rst作为DAO.recordset

设置rst = Forms!frm1!frm2.Form.RecordsetClone
Dim rst as DAO.recordset
Set rst = Forms!frm1!frm2.Form.RecordsetClone



假设frm2是充当子表单的表单的名称。

不要使用该名称,使用子表单的名称。因此,如果frm1有一个名为sub1的

子表单作为其源对象frm2,那么你可以像这样引用




表格!frm1.sub1.form.recordsetclone


有些人根本不会使用刘海,这有效:


表格。 frm1.sub1.form.recordsetclone


这在Access 97中是相同的,BTW。


-

Tim http://www.ucs.mun.ca/~tmarshal/

^ o<

/#)Burp-beep,burp-beep,burp-beep? - Quaker Jake

/ ^^小心点,大鸟! - 同上TIM-MAY !! - 我


Presumeably, frm2 is the name of the form that acts as the subform.
Don''t use that name, use the name of the subform. Thus if frm1 has a
subform named sub1 which has as its source object, frm2, then you refer
to it like this:

forms!frm1.sub1.form.recordsetclone

Some would not use the bangs at all and this works:

forms.frm1.sub1.form.recordsetclone

This was the same in Access 97, BTW.

--
Tim http://www.ucs.mun.ca/~tmarshal/
^o<
/#) "Burp-beep, burp-beep, burp-beep?" - Quaker Jake
/^^ "Be Careful, Big Bird!" - Ditto "TIM-MAY!!" - Me


我同意,如果Tim的假设是正确的,那么你的地址是不正确的。

为了解决控制C,在表格F2中,嵌入在子窗体控制SFC中,在表格F1中使用
,你会使用:


表格!F1!SFC.Form!C


请注意,嵌入在子窗体控件中的窗体名称不会是
出现在该地址中。


对你的建议没有喜悦很有说服力,但是它并没有详细说明

究竟是什么用的,你在哪里以及如何使用它,确切的错误是什么,

并没有帮助我们帮你。


Larry Linson

Microsoft Access MVP


< d。**** ***@orcf.co.nz在留言中写道

新闻:11 ********************** @ v45g2000cwv.googlegr oups。 com ...
I am in agreement that, if Tim''s assumption is correct, your addressing is
incorrect.

To address control C, in Form F2, which is embedded in Subform Control SFC,
in Form F1, you''d use:

Forms!F1!SFC.Form!C

Note that the name of the Form embedded in the Subform Control does not
appear in that address.

"no joy with your suggestion" is emphatic, but it doesn''t give details of
exactly what you used, where and how you used it, what the exact error was,
and does not help us to help you.

Larry Linson
Microsoft Access MVP

<d.*******@orcf.co.nzwrote in message
news:11**********************@v45g2000cwv.googlegr oups.com...

Tim - 谢谢你的回复,不过你的建议没什么乐趣


我跑过了几个测试,如果我在现在的Access 2003 db中创建一个新的表单和子表单,那么代码在建立子表单的

记录集克隆时没有问题。


当我将子表单插入到新的主表单中时,代码会起作用,

因此看起来主表单在某种程度上是损坏的。


我试图将旧表单的控件复制并粘贴到新的
主表单中,但错误仍然存​​在。只有在创建了新的主表单和新控件时才能解决问题




现在的问题是主表单包含一个带有大量的选项卡控件

字段,子表单等等,并且需要永远重新创建。


之前有没有人遇到过这个问题,有什么建议吗

复制主表单而不必重新创建每个控件

包括格式化等


Tim Marshall写道:
Tim - thank you for your reply, however no joy with your suggestion

I have run a few more tests and if I create a new form and subform in
the now Access 2003 db the code has no problem establishing a
recordsetclone of the subform.

When I insert the subform into a new master form the code then works,
therefore it appears the master form is corrupt in someway.

I have tried to copy and paste the controls of the old form into a new
master form, but the error still occurs. The problem is only resolved
when a new master form and new controls are created.

The problem now is the master form contains a tab control with numerous
fields, subforms, etc and would take forever to recreate.

Has anyone had this problem before and are there any suggestions on how
to replicate the master form without having to recreate every control
including formating, etc
Tim Marshall wrote:

> d。******* @ orcf.co.nz 写道:
>d.*******@orcf.co.nz wrote:

Dim rst作为DAO.recordset

Set rst = Forms!frm1!frm2.Form.RecordsetClone
Dim rst as DAO.recordset
Set rst = Forms!frm1!frm2.Form.RecordsetClone


假设frm2是充当子表单的表单的名称。
不要使用该名称,使用子表单的名称。因此,如果frm1有一个名为sub1的子窗体,它的源对象是frm2,那么你可以像这样引用


形式!frm1.sub1.form.recordsetclone

有些人根本不会使用刘海,这有效:

forms.frm1.sub1.form.recordsetclone

这是相同的Access 97,BTW。

- Tim http://www.ucs.mun.ca/~tmarshal/
^ o<
/#)" Burp-beep,burp-beep,burp-beep?" ; - Quaker Jake
/ ^^小心点,大鸟! - 同上TIM-MAY !! - Me


Presumeably, frm2 is the name of the form that acts as the subform.
Don''t use that name, use the name of the subform. Thus if frm1 has a
subform named sub1 which has as its source object, frm2, then you refer
to it like this:

forms!frm1.sub1.form.recordsetclone

Some would not use the bangs at all and this works:

forms.frm1.sub1.form.recordsetclone

This was the same in Access 97, BTW.

--
Tim http://www.ucs.mun.ca/~tmarshal/
^o<
/#) "Burp-beep, burp-beep, burp-beep?" - Quaker Jake
/^^ "Be Careful, Big Bird!" - Ditto "TIM-MAY!!" - Me



这篇关于记录集的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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