469,342 Members | 5,865 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,342 developers. It's quick & easy.

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_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
Nov 13 '05 #1
4 1995
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


Nov 13 '05 #2
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.
Nov 13 '05 #3
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
Nov 13 '05 #4
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.
Nov 13 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by PAUL | last post: by
3 posts views Thread by Michel Esber | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
1 post views Thread by haryvincent176 | last post: by
1 post views Thread by Marylou17 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.