473,378 Members | 1,417 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

Main form saving when click on subform??? A97

MLH
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

May 31 '07 #1
13 3982
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
May 31 '07 #2
MLH
>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.
Link Child Field and Link Master Field properties for the control
are Null. The subform functions as a glorified listbox control. The
form has worked for about a year w/ no problem. I just did something
in the past 60-90 days that caused this behaviour. It NEVER used to
save the incomplete record on the Main Form before now.
May 31 '07 #3
MLH wrote:
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.

Link Child Field and Link Master Field properties for the control
are Null. The subform functions as a glorified listbox control. The
form has worked for about a year w/ no problem. I just did something
in the past 60-90 days that caused this behaviour. It NEVER used to
save the incomplete record on the Main Form before now.
As far as I know moving focus to the subform is equivelant to moving to a
different record. The record in the main form is saved. The MasterLink and
ChildLink properties have nothing to do with it. Doesn't even matter if the
subform is unbound.

--
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com
May 31 '07 #4
MLH
>As far as I know moving focus to the subform is equivelant to moving to a
>different record. The record in the main form is saved. The MasterLink and
ChildLink properties have nothing to do with it. Doesn't even matter if the
subform is unbound.
You know, you're probably right. Now that I think about it, I could
never select the subform control in my earlier versions of this app
after I'd entered ANYTHING at all onto the main form. I always had
to make my entries on the subform control FIRST, then start making
the entries onto the main form. Once the main form's fields had been
properly filled out, I explicitly saved the record.

Gonna have to rethink this form.
May 31 '07 #5
On Wed, 30 May 2007 22:47:34 -0500, "Rick Brandt"
<ri*********@hotmail.comwrote:

That is correct. You can show the RecordSelector and see the pencil
turn into a triangle when you step into the subform.

-Tom.

>MLH wrote:
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.

Link Child Field and Link Master Field properties for the control
are Null. The subform functions as a glorified listbox control. The
form has worked for about a year w/ no problem. I just did something
in the past 60-90 days that caused this behaviour. It NEVER used to
save the incomplete record on the Main Form before now.

As far as I know moving focus to the subform is equivelant to moving to a
different record. The record in the main form is saved. The MasterLink and
ChildLink properties have nothing to do with it. Doesn't even matter if the
subform is unbound.
May 31 '07 #6
MLH
You guys are right. I've had the subform control on the form for a
long time. Because of my habit of first making my settings on the
subform control itself, then returning to the main form, I wasn't
noticing the action the way I am now.

What I was trying to do with the subform on the mainform was display
a list of records in tblAddnlOwners in a control that would let me
browse the records and click a checkbox in each record I wanted to
mark - setting the value of a Yes/No field in that table in one or
more records.

That's easy enough to do on an entirely separate form. Just pop the
form open, place checkmarks on the desired records and close the
form when done. I was trying to include such functionality on the main
form itself.I guess I thought a subform control would be like opening
another form - just imbedding it for display purposes on the main
form. Turns out nothing could be further from the truth.

Unless one of you guys know how I can do this, I'll just do away with
the subform control altogether and open the form that was the source
object of the subform control. That way, switching back 'n forth
between the 2 forms won't force a SAVE on the main form's incomplete
record.
May 31 '07 #7
Tom van Stiphout <no*************@cox.netwrote in
news:ul********************************@4ax.com:
You can show the RecordSelector and see the pencil
turn into a triangle when you step into the subform.
Well, that's kind of stupid, don't you think?

--
David W. Fenton http://www.dfenton.com/
usenet at dfenton dot com http://www.dfenton.com/DFA/
May 31 '07 #8
On Thu, 31 May 2007 15:14:51 -0500, "David W. Fenton"
<XX*******@dfenton.com.invalidwrote:

I was just trying to show him another way to verify that indeed the
parent record is saved when you step into the subform.
-Tom.

>Tom van Stiphout <no*************@cox.netwrote in
news:ul********************************@4ax.com :
>You can show the RecordSelector and see the pencil
turn into a triangle when you step into the subform.

Well, that's kind of stupid, don't you think?
Jun 1 '07 #9
rkc
David W. Fenton wrote:
Tom van Stiphout <no*************@cox.netwrote in
news:ul********************************@4ax.com:
>You can show the RecordSelector and see the pencil
turn into a triangle when you step into the subform.

Well, that's kind of stupid, don't you think?
I must be stupid because I do not understand this comment.
Jun 1 '07 #10
Tom van Stiphout <no*************@cox.netwrote in
news:4p********************************@4ax.com:
On Thu, 31 May 2007 15:14:51 -0500, "David W. Fenton"
<XX*******@dfenton.com.invalidwrote:
>>Tom van Stiphout <no*************@cox.netwrote in
news:ul********************************@4ax.co m:
>>You can show the RecordSelector and see the pencil
turn into a triangle when you step into the subform.

Well, that's kind of stupid, don't you think?

I was just trying to show him another way to verify that indeed
the parent record is saved when you step into the subform.
That wasn't directed at your suggestion -- it's that I think the
Access behavior is dumb. Sorry if that was confusing.

--
David W. Fenton http://www.dfenton.com/
usenet at dfenton dot com http://www.dfenton.com/DFA/
Jun 1 '07 #11
rkc <rk*@rkcny.yabba.dabba.do.comwrote in
news:46**********************@roadrunner.com:
David W. Fenton wrote:
>Tom van Stiphout <no*************@cox.netwrote in
news:ul********************************@4ax.com :
>>You can show the RecordSelector and see the pencil
turn into a triangle when you step into the subform.

Well, that's kind of stupid, don't you think?

I must be stupid because I do not understand this comment.
What I mean is that it's stupid that Access behaves that way.

--
David W. Fenton http://www.dfenton.com/
usenet at dfenton dot com http://www.dfenton.com/DFA/
Jun 1 '07 #12
David W. Fenton wrote:
rkc <rk*@rkcny.yabba.dabba.do.comwrote in
news:46**********************@roadrunner.com:
>David W. Fenton wrote:
>>Tom van Stiphout <no*************@cox.netwrote in
news:ul********************************@4ax.co m:

You can show the RecordSelector and see the pencil
turn into a triangle when you step into the subform.

Well, that's kind of stupid, don't you think?

I must be stupid because I do not understand this comment.

What I mean is that it's stupid that Access behaves that way.
It has to behave that way when the dirty main record is a new one or when
the linking fields are changed so I guess they just made it behave that way
all the time. Seems like they could at least not do it when the MasterLink
and ChildLink properties are not filled in (as would be the case with an
unbound subform).

--
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com
Jun 1 '07 #13
"Rick Brandt" <ri*********@hotmail.comwrote in
news:8a*****************@newssvr27.news.prodigy.ne t:
David W. Fenton wrote:
>rkc <rk*@rkcny.yabba.dabba.do.comwrote in
news:46**********************@roadrunner.com:
>>David W. Fenton wrote:
Tom van Stiphout <no*************@cox.netwrote in
news:ul********************************@4ax.com :

You can show the RecordSelector and see the pencil
turn into a triangle when you step into the subform.

Well, that's kind of stupid, don't you think?

I must be stupid because I do not understand this comment.

What I mean is that it's stupid that Access behaves that way.

It has to behave that way when the dirty main record is a new one
or when the linking fields are changed so I guess they just made
it behave that way all the time. Seems like they could at least
not do it when the MasterLink and ChildLink properties are not
filled in (as would be the case with an unbound subform).
That's my point here, and I assumed that's what you were talking
about. Obviously it *has* to be that way when there's a link field,
but you might have a non-data bearing subform, and moving to it
would save the parent record for no good reason whatsoever.

--
David W. Fenton http://www.dfenton.com/
usenet at dfenton dot com http://www.dfenton.com/DFA/
Jun 2 '07 #14

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: chris vettese | last post by:
I've been having trouble with this for a long time. I have a form that has many subforms. In the subforms I have unbound text boxes in the footer that sum a field. I want to Display this sum on...
3
by: Tracy | last post by:
Hi I'm hoping this is a problem just because I'm a beginner at Access, and so someone can help I have created a database of companies, with a subform for contacts. (seperate tables) It...
4
by: Dave Boyd | last post by:
Hi, I have two very similar forms each with a subform. The main form gets a few fields from the user and passes this back to a query that the subform is bound to. The requery is done when the...
2
by: origin197511 | last post by:
Hello all... I'm having an issue with MSAccess 2000. I have a Form that holds records of my cartridge loads for a rifle and a subform that lists all groups that have been fired with that load. ...
1
by: NBruch | last post by:
Ok let me explain what im trying to do: i need a combo box which needs to be linked to a listbox (or combo box doesnt matter which really) then the listbox should bring up the record in a...
6
by: MLH | last post by:
When the vehicle entry form (frmVehicleEntryForm) first opens, the additional owner SubForm control (frmAddnlOwnrListSubForm) is enabled. You can click on it and it will accept the focus. But after...
4
by: MLH | last post by:
I have a report and on it, a subreport control Main Report Name: rptInvoiceMain Sub Report Name: rptInvoiceSubReport SubReport Control Name: rptInvoiceSubReportCtl The...
4
by: Savita23 | last post by:
Hi, I have a subform in datasheet layout embedded in the main form.I want to invoke a procedure on the double click of each record in the subform.Is there a away by which I can fire the double...
1
by: greenstein | last post by:
Hello, I really need some help. I have a main form in Access 2000, with a subform, some of the fields in the subform are not saving to the table. When I search the Main form for the information,...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.