473,398 Members | 2,389 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,398 software developers and data experts.

How to avoid update?

Hi,
I have tab control on one of which pages is subform.
When I change data on one of pages and navigate to another, update in
database is happened.
Is there any way to avoid that?
Thanks
Nov 13 '05 #1
6 1875
Jet uses opportunistic record saving (automatic on form closing, when time
permits while changing focus, etc.), so no explicit "Save" command is needed
for most applications. Why would you want to disable this?
-Ed

"Igor" <Ig*********@sasktel.net> wrote in message
news:11*************@corp.supernews.com...
Hi,
I have tab control on one of which pages is subform.
When I change data on one of pages and navigate to another, update in
database is happened.
Is there any way to avoid that?
Thanks

Nov 13 '05 #2
Using an embedded subform when you leave the subform it loses focus and
the (sub)record gets saved. You might consider using temporary tables
to hold the data (the save still happens but to the temporary table).
You could then take whatever additional actions you wanted to take and
depending on whether or not you wanted to commit the changes you could
explicitly 'save' the record to the permanent tables using code or an
update/append query.

Nov 13 '05 #3
because I have a button for save and button for exit, so database is not
supposed to be updated just
because walking between pages. I can change data on one page, move to
another, decide that I don't want
this change and exit form.
It is especially ridiculous because I have confirmation message on Before
Update event
that asks if you want to save record, so this message pops up every time I
navigate to another page.

"Ed Robichaud" <ed*********@wdn.com> wrote in message
news:Pi******************@newshog.newsread.com...
Jet uses opportunistic record saving (automatic on form closing, when time
permits while changing focus, etc.), so no explicit "Save" command is
needed for most applications. Why would you want to disable this?
-Ed

"Igor" <Ig*********@sasktel.net> wrote in message
news:11*************@corp.supernews.com...
Hi,
I have tab control on one of which pages is subform.
When I change data on one of pages and navigate to another, update in
database is happened.
Is there any way to avoid that?
Thanks


Nov 13 '05 #4
Sorry, no. The Form / Subform combination is (mainly) designed to handle
Records in a One-to-Many realtionship and to enforce the R.I., the Record on
the MainForm is automatically saved when the Focus is moved from the
MainForm to the Subform. The Record on the Subform is also automatically
saved when the Focus moves from the Subform to the MainForm.

There are some work-arounds, e.g. using temp Tables or unbound Form/Subform
but they are equally messy and a fair bit of VBA code is required.

--
HTH
Van T. Dinh
MVP (Access)
"Igor" <Ig*********@sasktel.net> wrote in message
news:11*************@corp.supernews.com...
Hi,
I have tab control on one of which pages is subform.
When I change data on one of pages and navigate to another, update in
database is happened.
Is there any way to avoid that?
Thanks

Nov 13 '05 #5
To flesh out this answer a little more...

Often, when there is a need to save data in several tables all at once (such
as a master and details), it's best to have some kind of batch posting
mechanism, so the data is entered into a staging table or with a pending
status, then, when a Post action is requested, copy the data into the
permanent table, or remove the pending status flag on the master record for
the entry.

There are side benefits to this approach, including the fact that a user can
leave an entry 1/2 done, close the program, come back later, finish it, and
post it. This scheme can also overlap with other useful business metaphors,
for instance, a pending order can double as an estimate.

On 18 Feb 2005 17:30:59 -0800, "Barry-Jon" <ba**************@yahoo.co.uk>
wrote:
Using an embedded subform when you leave the subform it loses focus and
the (sub)record gets saved. You might consider using temporary tables
to hold the data (the save still happens but to the temporary table).
You could then take whatever additional actions you wanted to take and
depending on whether or not you wanted to commit the changes you could
explicitly 'save' the record to the permanent tables using code or an
update/append query.


Nov 13 '05 #6
This works for me ... my save button is called cmdSave ...

Private Sub Form_BeforeUpdate(Cancel As Integer)
If Screen.ActiveControl.Name <> "cmdSave" Then
Cancel = True
else
... whatever you want to do before updating the record

end if

HTH,
Debbie
"Igor" <Ig*********@sasktel.net> wrote in message
news:11*************@corp.supernews.com...
| Hi,
| I have tab control on one of which pages is subform.
| When I change data on one of pages and navigate to another, update in
| database is happened.
| Is there any way to avoid that?
| Thanks
|
|
Nov 13 '05 #7

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

Similar topics

7
by: Kannan | last post by:
Hello, I have a situation which would essentially use a co-related subquery. I am trying to avoid using a co-related subquery due to its slow performanc and use a join statement instead. Here...
3
by: SuryaPrakash Patel via SQLMonster.com | last post by:
Hello, There are three tables: OS-GroupOFCompanies (Table1) GoC_GroupOFCompaniesID (PK) OS-Organization (Table 2) Org_OrganizationID (PK)
22
by: T.S.Negi | last post by:
Hi All, I want to avoid using cursors and loops in stored procedures. Please suggest alternate solutions with example (if possible). Any suggestion in these regards will be appreciated. ...
5
by: vanisathish | last post by:
Hi All, I need to constantly update some values to the User Interface. In order to do the updation efficiently, i am planning to run some script in the server side that constantly keeps sending...
7
by: David Laub | last post by:
I have stumbled across various Netscape issues, none of which appear to be solvable by tweaking the clientTarget or targetSchema properties. At this point, I'm not even interested in "solving"...
6
by: betbubble | last post by:
I need help on two questions: 1. Is temp table the only way to pass recordsets from a nested stored procedure to a calling stored procedure? Can we avoid temp tables in this case? 2. Are...
0
by: halex | last post by:
Hello, I am having deadlock problem when I have a lot of visitors on my website at the same time. I am using NetTiers templates to generate C# classes for accessing DB layer and problem is in my...
0
by: Eraser | last post by:
Hi to all .NET guru guys... I have a problem in my delete button inside gridview. How to avoid postback on when i select cancel on confirmation message? But postback is okay on Ok confirmation....
8
by: lenygold via DBMonster.com | last post by:
What about using delete/insert instead of update? Lennart wrote: -- Message posted via DBMonster.com http://www.dbmonster.com/Uwe/Forums.aspx/ibm-db2/200807/1
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.