I guessed that's what you meant...it didn't change it back to the original. i
must be missing something.
Thanks anyways...I found a workaround and made a modify button :)
Quote:
> You would do it like this:
> Private Sub AccountRep_BeforeUpdate(Cancel As Integer)
> If Me!AccountRep = "Modify" Then
> Me!AccountRep.Undo
> Cancel = True
> DoCmd.OpenForm "frmAccountRep
> Else
> End If
> End Sub
> I still don't know for sure that this will solve your problem with Undo, but
> it should stop the control from being updated.
> --
> Dirk Goldgar
> (remove NOSPAM from reply address)
> > where do you set the parameter? the code is:
> > Private Sub AccountRep_BeforeUpdate(Cancel As Integer)
> > If Me!AccountRep = "Modify" Then
> > Me!AccountRep.Undo
> > DoCmd.OpenForm "frmAccountRep"
> > Else
> > End If
> > End Sub
> > > Just guessing, but when you have this code in the BeforeUpdate event, do
> you
> > > also set the Cancel parameter to True? I'm thinking maybe you have to.
> > > --
> > > Dirk Goldgar
> > > (remove NOSPAM from reply address)
> > > > This should be simple, but for some reason, it's not working for me.
> > > > I have a combo box with a list of account reps...I did a union query
> to
> > > > include a "Modify".
> > > > If a user choose "Modify", I want the combo box to be undone and then
> > > > open another form.
> > > > In the event procedure of the AccountRep beforeupdate (or on change),
> i
> > > > have the following function:
> > > > If Me!AccountRep = "Modify" Then
> > > > Me!AccountRep.Undo
> > > > Do.cmd OpenForm "frmAccountRep"
> > > > Else
> > > > End If
> > > > The combo box doesn't undo. I tried it in the beforeupdate and on
> > > > change. When I substitute the Me!AccountRep.Undo for SendKeys
> "{ESC}",
> > > > it works, but it undoes all the changes in the form. I just want to
> > > > undo that combo box.
> > > > I even tried writing out the form name, instead of "Me!"...that still
> > > > didnt work.
> > > > What am I doing wrong?
> > > > Thanks.
> > > > Ngan