By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,197 Members | 1,173 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,197 IT Pros & Developers. It's quick & easy.

Not update record using Navigator in MS Access

P: n/a
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
Share this Question
Share on Google+
4 Replies


P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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.