473,849 Members | 1,797 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Not update record using Navigator in MS Access

Hello there,

I have a bound-form using Navigator so that the user can move back and
forth to update record in the form. Every time a record was modified
and the user clicks the Navigator to either move backward or forward
to the next record, a message is popped up asking the user to confirm
the change. If the user clicks "Yes", the record should be updated
and the Navigator takes the user to the next record as clicked. If
the user does not want that change (clicks "No"), the record should
not be updated and still move backward or forward as the user chosed
so.

So, I think the best place to put this trap is in Form_BeforeUpda te
event, here is what I have (at the end of the event):

If MsgBox("Do you want to save this change?", vbYesNo, "Save changed")
= vbNo
Cancel = True
Exit Sub
End If

So far, after the user makes some change to the record and clicks the
Navigator: if the user clicks "Yes", the record updated fine and goes
to the next record as the Navigator direction was chosen.

My problem is when the user clicks "No": the record is not updated but
it stays right there without moving to the next record. Are there any
ways I could do to make the record not updating but still move as the
Navigator clicked?

Any helps are appreciated,
James
Nov 13 '05 #1
4 2207
Use the Me.Undo in place of Cancel=True.

--
MGFoster:::mgf0 0 <at> earthlink <decimal-point> net
Oakland, CA (USA)

James P. wrote:
Hello there,

I have a bound-form using Navigator so that the user can move back and
forth to update record in the form. Every time a record was modified
and the user clicks the Navigator to either move backward or forward
to the next record, a message is popped up asking the user to confirm
the change. If the user clicks "Yes", the record should be updated
and the Navigator takes the user to the next record as clicked. If
the user does not want that change (clicks "No"), the record should
not be updated and still move backward or forward as the user chosed
so.

So, I think the best place to put this trap is in Form_BeforeUpda te
event, here is what I have (at the end of the event):

If MsgBox("Do you want to save this change?", vbYesNo, "Save changed")
= vbNo
Cancel = True
Exit Sub
End If

So far, after the user makes some change to the record and clicks the
Navigator: if the user clicks "Yes", the record updated fine and goes
to the next record as the Navigator direction was chosen.

My problem is when the user clicks "No": the record is not updated but
it stays right there without moving to the next record. Are there any
ways I could do to make the record not updating but still move as the
Navigator clicked?

Any helps are appreciated,
James


Nov 13 '05 #2
MGFoster <me@privacy.com > wrote in message news:<cr******* ***********@new sread1.news.pas .earthlink.net> ...
Use the Me.Undo in place of Cancel=True.

--
MGFoster:::mgf0 0 <at> earthlink <decimal-point> net
Oakland, CA (USA)

James P. wrote:
Hello there,

I have a bound-form using Navigator so that the user can move back and
forth to update record in the form. Every time a record was modified
and the user clicks the Navigator to either move backward or forward
to the next record, a message is popped up asking the user to confirm
the change. If the user clicks "Yes", the record should be updated
and the Navigator takes the user to the next record as clicked. If
the user does not want that change (clicks "No"), the record should
not be updated and still move backward or forward as the user chosed
so.

So, I think the best place to put this trap is in Form_BeforeUpda te
event, here is what I have (at the end of the event):

If MsgBox("Do you want to save this change?", vbYesNo, "Save changed")
= vbNo
Cancel = True
Exit Sub
End If

So far, after the user makes some change to the record and clicks the
Navigator: if the user clicks "Yes", the record updated fine and goes
to the next record as the Navigator direction was chosen.

My problem is when the user clicks "No": the record is not updated but
it stays right there without moving to the next record. Are there any
ways I could do to make the record not updating but still move as the
Navigator clicked?

Any helps are appreciated,
James


Thank you so much for that. It works exactly the way I would like.
Nov 13 '05 #3
MGFoster <me@privacy.com > wrote in message news:<cr******* ***********@new sread1.news.pas .earthlink.net> ...
Use the Me.Undo in place of Cancel=True.

--
MGFoster:::mgf0 0 <at> earthlink <decimal-point> net
Oakland, CA (USA)

James P. wrote:
Hello there,

I have a bound-form using Navigator so that the user can move back and
forth to update record in the form. Every time a record was modified
and the user clicks the Navigator to either move backward or forward
to the next record, a message is popped up asking the user to confirm
the change. If the user clicks "Yes", the record should be updated
and the Navigator takes the user to the next record as clicked. If
the user does not want that change (clicks "No"), the record should
not be updated and still move backward or forward as the user chosed
so.

So, I think the best place to put this trap is in Form_BeforeUpda te
event, here is what I have (at the end of the event):

If MsgBox("Do you want to save this change?", vbYesNo, "Save changed")
= vbNo
Cancel = True
Exit Sub
End If

So far, after the user makes some change to the record and clicks the
Navigator: if the user clicks "Yes", the record updated fine and goes
to the next record as the Navigator direction was chosen.

My problem is when the user clicks "No": the record is not updated but
it stays right there without moving to the next record. Are there any
ways I could do to make the record not updating but still move as the
Navigator clicked?

Any helps are appreciated,
James


Using the Navigator and applied the Undo command in Form_BeforeUpda te
event worked great for me when I used it for the first record I
encountered. But after that, if I want to update the next record
while still using the Navigator, it seems like that Undo would still
apply to the whole Form_BeforeUpda te after the first time the Undo was
activated and would not "know" that the form is being changed the
second time so I can update the next record.

Is my assumption right about the Undo command? Are there anyway I can
go back to "normal" stage in Form_BeforeUpda te in this case to allow
updating other records?

Thanks a lot,
James
Nov 13 '05 #4
ha*********@yah oo.com (James P.) wrote in message news:<f4******* *************** ****@posting.go ogle.com>...
MGFoster <me@privacy.com > wrote in message news:<cr******* ***********@new sread1.news.pas .earthlink.net> ...
Use the Me.Undo in place of Cancel=True.

--
MGFoster:::mgf0 0 <at> earthlink <decimal-point> net
Oakland, CA (USA)

James P. wrote:
Hello there,

I have a bound-form using Navigator so that the user can move back and
forth to update record in the form. Every time a record was modified
and the user clicks the Navigator to either move backward or forward
to the next record, a message is popped up asking the user to confirm
the change. If the user clicks "Yes", the record should be updated
and the Navigator takes the user to the next record as clicked. If
the user does not want that change (clicks "No"), the record should
not be updated and still move backward or forward as the user chosed
so.

So, I think the best place to put this trap is in Form_BeforeUpda te
event, here is what I have (at the end of the event):

If MsgBox("Do you want to save this change?", vbYesNo, "Save changed")
= vbNo
Cancel = True
Exit Sub
End If

So far, after the user makes some change to the record and clicks the
Navigator: if the user clicks "Yes", the record updated fine and goes
to the next record as the Navigator direction was chosen.

My problem is when the user clicks "No": the record is not updated but
it stays right there without moving to the next record. Are there any
ways I could do to make the record not updating but still move as the
Navigator clicked?

Any helps are appreciated,
James


Thank you so much for that. It works exactly the way I would like.


Never mind, guys. It's my fault. I had set up my own flag to prevent
it to update. So, I'm ok now.
Nov 13 '05 #5

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

Similar topics

4
3347
by: dhcomcast | last post by:
We're starting to use Oracle for the back-end instead of a separate Access .mdb file for the data and everything as gone surprisingly well so far. We are learning Oracle as we go; Yikes! But we have very patient DBA's at the main office to answer newbie questions. Using Access 2002 with linked ODBC tables to Oracle 9 (9i? not sure), ODBC driver is SQORA32.DLL, verson 9.02.00.00. My "Error 3167: Record is deleted" comes when I use...
0
3650
by: Patrick | last post by:
I'm working on a contact management application, and need a hand with one aspect... Here's what I want to create: ------------------------------------ A form split into two parts. There is a datagrid on the left side that lists names and perhaps a couple of other key fields. The user can click on a record in the datagrid, which should automatically pull up details on that record in the various text boxes and other controls on the right...
5
3548
by: PAUL | last post by:
Hello, I have 2 tables with a relationship set up in the dataset with vb ..net. I add a new record to the parent table then edit an existing child record to have the new parent ID. However when I do the update the changed parentid in the child table fails to change. No error is given its just that the change is not written to the Database. When I step through the records for the child table the one I would expect to be changed has a row...
2
19624
by: Brett | last post by:
My database has 2 tables: Table1 & Table2. If a field is not null on a record in table2, then the not null fields in table1 that correspond to the records in table1 needs to be updated to match the field in table2. What I have is a form that is linked to Table2. If the users want to change a field in the main database (table1), they fill the change in to the form (which is linked to table2) If there is no change to the field, they simply...
7
27846
by: Dale Sampson | last post by:
As you can tell, I am new to VS.net. I have a VB project with a defined data source pointing to a table in a ..mdb file.-- The associated fields are displayed in textboxes using the tableBindingSource. There is also an associated BindingNavigator. The table's primary key is a field called 'who'. I have a valid value for 'who' and want to set the Navigator to the record that contains this value so the fields are displayed in the associated...
5
2606
by: njb35 | last post by:
Hi all I'm beginning my foray from VBA into VB 2005 Express, and enjoying some of the efficiencies it provides! I'm stuck with some dataset handling however that I _think_ can be automated but I can probably code what I want to do the hard way. I've searching around online but can't find an answer to this specific question. Here's the situation: I have a dataset table with 3 fields: one indexed as a primary key and the other two...
2
10093
by: Randy | last post by:
Hi, I'm trying to figure out some binding navigator code. If I have the primary field value as selected by the user in a combo box, how can I instruct the binding navigator to move to that record. Here is what I have so far: Dim strSQL As String strSQL = "SELECT OrderID WHERE OrderID = @OrderID" Dim cmdSelect As New SqlCommand(strSQL, cn) cmdSelect.Parameters.AddWithValue("@OrderID, cboOrderID.text)
0
4105
by: Cindy Huyser | last post by:
I have an Access 2000 database behind a threaded Java application that that can have have concurrent access to the same table (but not the same record). The database is set up for shared access with "No locks" as the default, so that optimistic record locking should take place, and "Open databases using record-level locking" is selected. Each Java thread gets a new connection to the database, then updates its record. One of my users has...
3
3980
by: Michel Esber | last post by:
Hi all, DB2 V8 LUW FP 15 There is a table T (ID varchar (24), ABC timestamp). ID is PK. Our application needs to frequently update T with a new value for ABC. update T set ABC=? where ID = ?
0
9893
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
11005
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10665
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10723
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9501
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5735
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5921
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4544
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4139
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.