VBA访问:从另一个表单的代码刷新表单

编程入门 行业动态 更新时间:2024-10-11 01:17:54
本文介绍了VBA访问:从另一个表单的代码刷新表单的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

没关系,有人帮了我. form_(name).recalc或form_(name).refresh: form_main.recalc

nevermind someone helped me. form_(name).recalc or form_(name).refresh: form_main.recalc

我有两种形式:主要",细节". 在主"窗体中,我有一个在对话框中打开详细信息"的按钮. 问题是我有一个详细信息"复选框,当进行更改时, 我需要刷新主要". 这是什么命令? 谢谢

I have two forms: "main", "details". In the "main" form, I have a button that opens "details" in a dialog. The problem is that I have a checkbox in "details" and when in changes, I need to refresh "main". What command do that? Thank you

推荐答案

我将提供与您自己发现的答案不同的答案:

I'm going to provide a different answer than the one you discovered for yourself:

使用acDialog开关打开详细信息表单,然后在关闭时重新查询.打开详细信息表单的事件将如下所示(它将在主表单中):

Open the detail form with the acDialog switch, and then requery when it is closed. The event that opens the detail form would look like this (it would be in the main form):

DoCmd.OpenForm "DetailForm", , , "ID=" & Me!ID, , acDialog Me.Requery

这是在打开详细信息表单的情况下暂停代码.当您关闭详细信息表单时,它将重新查询主表单.

What this does is pause the code with the detail form open. When you close the detail form, it will requery the main form.

在我看来,这是做这种事情的标准方法.

This is the standard way of doing this kind of thing, seems to me.

更多推荐

VBA访问:从另一个表单的代码刷新表单

本文发布于:2023-11-02 10:02:53,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1552088.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:表单   代码   VBA

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!