单击子窗体时保存主窗体??? A97 [英] Main form saving when click on subform??? A97
问题描述
我有一个表单frmVehicleEntryForm。
它是一个名为frmAddnlOwnrListSubForm的子窗体控件。
子窗体控件的源对象是frmAddnlOwnrListSubForm。
当我点击子窗体控件时,尝试尝试在主窗体上保存部分
输入的记录。我不明白
这种行为的来源或原因。我不知道在哪里可以看到
。知道这种行为的人吗?
这是'我的子窗体控件'的Enter事件过程:
Private Sub frmAddnlOwnrListSubForm_Enter()
Me!frmAddnlOwnrListSubForm.Width = 5.2604 * 1440
Me.Repaint
End Sub
这里是一个片段从我的主要表单''B4Update事件代码...
私有子Form_BeforeUpdate(取消为整数)
错误GoTo Err_Form_BeforeUpdate
Dim ThisForm As String
ThisForm = Me.Name
如果SaveButtonClicked = False那么
DoCmd.CancelEvent
MyString = SAVE按钮启动了SAVE操作,没有HARD CLICK
。那个
MyString = MyString& 此表格不允许。保存
操作已中止。
MsgBox MyString,vbExclamation," HARD CLICK Required - " &
MyApp $& ",rev。 " &安培; MY_VERSION $
退出Sub
结束如果
这就是我发现正在尝试SAVE的方式。如果我
没有代码可以执行此操作 - 为什么Access尝试这样做?
子窗体上的唯一代码是.. 。
选项比较数据库
选项明确
Sub Form_Close()
DoCmd.SetWarnings True
End Sub
I have a form, frmVehicleEntryForm.
On it is a subform control named frmAddnlOwnrListSubForm.
The subform control''s source object is frmAddnlOwnrListSubForm.
When I click on the subform control, an attempt to SAVE the partially
entered record on the main form is attempted. I do not understand
where this behavior is coming from or why. Haven''t a clue where to
look. Anyone familiar with this behaviour?
Here''s my subform control''s Enter event procedure:
Private Sub frmAddnlOwnrListSubForm_Enter()
Me!frmAddnlOwnrListSubForm.Width = 5.2604 * 1440
Me.Repaint
End Sub
Here''s a snippet from my main form''s B4Update event code...
Private Sub Form_BeforeUpdate(Cancel As Integer)
On Error GoTo Err_Form_BeforeUpdate
Dim ThisForm As String
ThisForm = Me.Name
If SaveButtonClicked = False Then
DoCmd.CancelEvent
MyString = "A SAVE action was initiated without a HARD CLICK
of the SAVE button. That "
MyString = MyString & "is not permissable on this form. SAVE
action has been aborted."
MsgBox MyString, vbExclamation, "HARD CLICK Required - " &
MyApp$ & ", rev. " & MY_VERSION$
Exit Sub
End If
So this is how I''m finding out that a SAVE is being attempted. If I
don''t have code that is doing it - why is Access attempting to do it?
The ONLY code on the subform is...
Option Compare Database
Option Explicit
Sub Form_Close()
DoCmd.SetWarnings True
End Sub
推荐答案
& ",rev。 " &安培; MY_VERSION
& ", rev. " & MY_VERSION
退出Sub
结束如果
这就是我的意思我发现正在尝试SAVE。如果我
没有代码可以执行此操作 - 为什么Access尝试这样做?
子窗体上的唯一代码是.. 。
选项比较数据库
选项明确
Sub Form_Close()
DoCmd.SetWarnings True
结束子
Exit Sub
End If
So this is how I''m finding out that a SAVE is being attempted. If I
don''t have code that is doing it - why is Access attempting to do it?
The ONLY code on the subform is...
Option Compare Database
Option Explicit
Sub Form_Close()
DoCmd.SetWarnings True
End Sub
MLH写道:
MLH wrote:
我有一个表单,frmVehicleEntryForm。
它是一个名为frmAddnlOwnrListSubForm的子表单控件。
子表单控件的源对象是frmAddnlOwnrListSubForm。
当我单击子窗体控件时,尝试尝试在主窗体上保存部分
输入的记录。我不明白
这种行为的来源或原因。我不知道在哪里可以看到
。知道这种行为的人吗?
这是'我的子窗体控件'的Enter事件过程:
Private Sub frmAddnlOwnrListSubForm_Enter()
Me!frmAddnlOwnrListSubForm.Width = 5.2604 * 1440
Me.Repaint
End Sub
这里是一个片段从我的主要表单''B4Update事件代码...
私有子Form_BeforeUpdate(取消为整数)
错误GoTo Err_Form_BeforeUpdate
Dim ThisForm As String
ThisForm = Me.Name
如果SaveButtonClicked = False那么
DoCmd.CancelEvent
MyString = SAVE按钮启动了SAVE操作,没有HARD CLICK
。那个
MyString = MyString& 此表格不允许。保存
操作已中止。
MsgBox MyString,vbExclamation," HARD CLICK Required - " &
MyApp
I have a form, frmVehicleEntryForm.
On it is a subform control named frmAddnlOwnrListSubForm.
The subform control''s source object is frmAddnlOwnrListSubForm.
When I click on the subform control, an attempt to SAVE the partially
entered record on the main form is attempted. I do not understand
where this behavior is coming from or why. Haven''t a clue where to
look. Anyone familiar with this behaviour?
Here''s my subform control''s Enter event procedure:
Private Sub frmAddnlOwnrListSubForm_Enter()
Me!frmAddnlOwnrListSubForm.Width = 5.2604 * 1440
Me.Repaint
End Sub
Here''s a snippet from my main form''s B4Update event code...
Private Sub Form_BeforeUpdate(Cancel As Integer)
On Error GoTo Err_Form_BeforeUpdate
Dim ThisForm As String
ThisForm = Me.Name
If SaveButtonClicked = False Then
DoCmd.CancelEvent
MyString = "A SAVE action was initiated without a HARD CLICK
of the SAVE button. That "
MyString = MyString & "is not permissable on this form. SAVE
action has been aborted."
MsgBox MyString, vbExclamation, "HARD CLICK Required - " &
MyApp
这篇关于单击子窗体时保存主窗体??? A97的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!