Re: Main form saving when click on subform??? A97
- From: "Rick Brandt" <rickbrandt2@xxxxxxxxxxx>
- Date: Wed, 30 May 2007 21:45:38 -0500
MLH wrote:
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
It'd normal, it's expected, and you can't change it.
Child records are normally only allowed (by the relationship setting) when
related to an existing parent record. You can't have an existing parent record
unless you save the parent upon moving to the subform.
--
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com
.
- Follow-Ups:
- References:
- Prev by Date: Re: Error 2501 Top Tip
- Next by Date: Re: Main form saving when click on subform??? A97
- Previous by thread: Main form saving when click on subform??? A97
- Next by thread: Re: Main form saving when click on subform??? A97
- Index(es):