本文介绍了形式与子表单重新查询问题 - ADO相关?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 我正在使用Access 2003.(我在我的绝大部分代码中也使用了ADO。我最近阅读了一篇帖子,表明ADO不是最初被破解的。在我的脑海中我很想知道这是否会导致我的问题,但我不想通过工作转换为DAO,除非我知道这真的符合我的最佳利益。) 我我有问题得到一个requery一致地出现在几种形式。我已经阅读了关于这个主题的各种帖子,但我不会开始理解为什么我不能这样做。我有以下设置: 表格A = CourseInfoForm 表格B = OutcomeQuestionsForm 子表格C =结果问题表格 子表格C控制名称= sbfOutcomeQuestionsSubform 表格B&子表单C由一个名为ClassID的字段链接。 表单A包含一系列课程。您可以选择课程并单击按钮转到表单B.表单B包含所选课程的详细信息,以及与子表单C中的课程相关的问题。 在表格B上,用户可以单击按钮运行查询,将问题从另一个课程复制到当前课程中。这些问题将插入到Subform C查询的表中。在成功插入之后,我尝试了几种方法来重新查询或重新显示Subform C上的数据。在极少数情况下,新插入的行将出现在子表单C中,但通常我必须手动关闭表单B和子表单C并重新打开它们以查看更改。 以下是我的一些尝试: 1. Me.sbfOutcomeQuestionsSubform.Form.Requery?子表单C 2 。Me.sbfOutcomeQuestionsSubform.Form.Recalc?子表格C 3. Me.Requery?表格B?希望它重新查询子表单C 4. Me.OutcomeQuestionsForm.Requery?表单B?希望它重新查询子表单C 5.调用Me.sbfOutcomeQuestionsSubform.Form.Form_Load?试图强制加载子表单C重新加载。 6.?我甚至试图自动关闭并重新打开表格B&子表单C DoCmd.Close acForm,OutcomeQuestionsForm DoCmd.OpenFormOutcomeQuestionsForm 我已包括来自按钮的代码点击,以防它可能暴露问题。 I am using Access 2003. (I am also using ADO in the vast majority of my code. I recently read a post that indicated that ADO is not all that is was initially cracked up to be. In the back of my mind I am wonder if this is causing my problem, but I don?t want to go through the work to convert to DAO unless I know it is truly in my best interest.) I am having problems getting a requery to show up consistently on a couple of forms. I have read all kinds of post on this subject, but I don?t begin to understand why I can?t get this to work. I have the following setup: Form A = CourseInfoFormForm B = OutcomeQuestionsFormSubform C = OutcomeQuestionsSubform Subform C Control Name = sbfOutcomeQuestionsSubform Form B & Subform C are linked by a field called ClassID. Form A contains a list of courses. You can select a course and click a button to go to Form B. Form B contains detail information for the selected course, along with Questions associated with the course that reside on Subform C. On Form B the user can click a button to run a query to copy questions from another course into the current course. These questions are inserted into a table that Subform C queries against. After a successful insert I have tried several approaches to requery or redisplay the data on Subform C. On rare occasions the newly insert rows will appear in Subform C, but usually I have to mannually close Form B and Subform C and reopen them to see the changes. Here are some of my attempts:1. Me.sbfOutcomeQuestionsSubform.Form.Requery ?Subform C2. Me.sbfOutcomeQuestionsSubform.Form.Recalc ?Subform C3. Me.Requery ?Form B ? hoping it requery Subform C4. Me.OutcomeQuestionsForm.Requery ?Form B ? hoping it requery Subform C5. Call Me.sbfOutcomeQuestionsSubform.Form.Form_Load ?attempting to force a load subform C to reload.6. ? I have even tried to automatically close and reopen Form B & Subform C DoCmd.Close acForm, "OutcomeQuestionsForm" DoCmd.OpenForm "OutcomeQuestionsForm" I have included the code from the button click in case it might expose the problem. 展开 | 选择 | Wrap | 行号 推荐答案 展开 | 选择 | 换行 | 行号 这篇关于形式与子表单重新查询问题 - ADO相关?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 10-18 15:14