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_BeforeUpdate
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 4 2179
Use the Me.Undo in place of Cancel=True.
--
MGFoster:::mgf00 <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_BeforeUpdate 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
MGFoster <me@privacy.com> wrote in message news:<cr******************@newsread1.news.pas.eart hlink.net>... Use the Me.Undo in place of Cancel=True.
-- MGFoster:::mgf00 <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_BeforeUpdate 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.
MGFoster <me@privacy.com> wrote in message news:<cr******************@newsread1.news.pas.eart hlink.net>... Use the Me.Undo in place of Cancel=True.
-- MGFoster:::mgf00 <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_BeforeUpdate 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_BeforeUpdate
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_BeforeUpdate 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_BeforeUpdate in this case to allow
updating other records?
Thanks a lot,
James ha*********@yahoo.com (James P.) wrote in message news:<f4**************************@posting.google. com>... MGFoster <me@privacy.com> wrote in message news:<cr******************@newsread1.news.pas.eart hlink.net>... Use the Me.Undo in place of Cancel=True.
-- MGFoster:::mgf00 <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_BeforeUpdate 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. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
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...
|
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...
|
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...
|
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...
|
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...
|
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...
|
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...
|
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...
|
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...
|
by: MeoLessi9 |
last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
|
by: DolphinDB |
last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation.
Take...
|
by: Aftab Ahmad |
last post by:
Hello Experts!
I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
|
by: ryjfgjl |
last post by:
ExcelToDatabase: batch import excel into database automatically...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: Vimpel783 |
last post by:
Hello!
Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
|
by: jfyes |
last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
|
by: PapaRatzi |
last post by:
Hello,
I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
| |