Connecting Tech Pros Worldwide Help | Site Map

Not update record using Navigator in MS Access

James P.
Guest
 
Posts: n/a
#1: Nov 13 '05
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
Guest
 
Posts: n/a
#2: Nov 13 '05

re: Not update record using Navigator in MS Access


Use the Me.Undo in place of Cancel=True.

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

James P. wrote:
[color=blue]
> 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[/color]

James P.
Guest
 
Posts: n/a
#3: Nov 13 '05

re: Not update record using Navigator in MS Access


MGFoster <me@privacy.com> wrote in message news:<crJ%c.10628$w%6.8073@newsread1.news.pas.eart hlink.net>...[color=blue]
> Use the Me.Undo in place of Cancel=True.
>
> --
> MGFoster:::mgf00 <at> earthlink <decimal-point> net
> Oakland, CA (USA)
>
> James P. wrote:
>[color=green]
> > 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[/color][/color]

Thank you so much for that. It works exactly the way I would like.
James P.
Guest
 
Posts: n/a
#4: Nov 13 '05

re: Not update record using Navigator in MS Access


MGFoster <me@privacy.com> wrote in message news:<crJ%c.10628$w%6.8073@newsread1.news.pas.eart hlink.net>...[color=blue]
> Use the Me.Undo in place of Cancel=True.
>
> --
> MGFoster:::mgf00 <at> earthlink <decimal-point> net
> Oakland, CA (USA)
>
> James P. wrote:
>[color=green]
> > 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[/color][/color]

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
James P.
Guest
 
Posts: n/a
#5: Nov 13 '05

re: Not update record using Navigator in MS Access


hanoi_honai@yahoo.com (James P.) wrote in message news:<f49d1d72.0409082051.61dfb5d1@posting.google. com>...[color=blue]
> MGFoster <me@privacy.com> wrote in message news:<crJ%c.10628$w%6.8073@newsread1.news.pas.eart hlink.net>...[color=green]
> > Use the Me.Undo in place of Cancel=True.
> >
> > --
> > MGFoster:::mgf00 <at> earthlink <decimal-point> net
> > Oakland, CA (USA)
> >
> > James P. wrote:
> >[color=darkred]
> > > 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[/color][/color]
>
> Thank you so much for that. It works exactly the way I would like.[/color]

Never mind, guys. It's my fault. I had set up my own flag to prevent
it to update. So, I'm ok now.
Closed Thread