本文介绍了在开放和QUOT;的&QUOT之间的差异;事件和"在负载和QUOT;事件数据输入表单的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我设计了一个数据录入表格进行调查。对于每一个调查问题,答案只有一个,可以从选择题的答案列表中进行选择。我使用了选项组(一组单选按钮)控制每一组选择题的答案,这样一组内的每个可能的答案旁边都有一个单选按钮,点击它时,会选择那个答案。每当表格最初显示(我不知道要不要说打开或装)的使用,我想每一个选项组有没有它的答案中选择。我知道VBA code使用来实现这一目标。我想知道有载事件和关于开放式事件的任何数据输入表单之间的差异。知道的区别后,我就知道并理解这两个事件的应用VBA code到。

I have designed a data-entry Form for conducting a survey.For each survey question, only one answer can be selected from a list of multiple-choice answers.I have used an "Option group"(a set of radio buttons)Control for each set of multiple-choice answers such that each possible answer within the set has a radio button beside it which when clicked, would select that answer.Whenever the form is initially displayed(I'm not sure whether to say "opened" or "loaded") for use, I want each "Option group" to have none of its answers selected.I know the VBA code to use to achieve this. I wish to know the difference between the "On Load" event and the "On Open" event for any data-entry Form.After knowing the difference, I will know and understand which of these two events to apply the VBA code to.

推荐答案

打开

打开负载发生之前,并允许您取消,因此无法打开。它还允许访问OpenArgs。这可能是有益的,如果你的表格要求用户输入。如果不提供,你可以取消Form.Open或提示用户输入需要的值。

Open happens before Load and allows you to cancel so it doesn't open. It also allows access to OpenArgs. This can be helpful if your form requires user input. If it is not supplied, you can cancel the Form.Open or prompt the user for needed values.

Private Sub Form_Open(Cancel As Integer)
     If "" & OpenArgs = "" Then
         Cancel = True
         Msgbox "Open Arguments are required"
     End If
End Sub

加载

加载后打开发生,没有任何控制公开赛提供。

Load happens after Open and lacks any of the control Open provides.

Private Sub Form_Load()
    Me.Caption = Date
End Sub

您可能需要使用这两个事件。使用开放获取的输入参数,并使用负载来设置的基于这些提供的参数控制值。

You may want to use both Events. Use Open to get the input parameters, and use Load to set the values of controls based on those supplied parameters.

引用

  • Form.Open Event
  • Form.Load Event

这篇关于在开放和QUOT;的&QUOT之间的差异;事件和"在负载和QUOT;事件数据输入表单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-16 02:46