Saving previous value of combo box

puthenveetil

Registered User.
Local time
Today, 22:31
Joined
Aug 9, 2004
Messages
94
Hi all,

I had a small problem with combo box . Is there any way to store the previous value of the combo box. Last time Pat showed me a way to collect the value by .oldvalue property of the combo box and it worked fine. But it working only for saved record and one time only. If I choose different value one more time without saving the record, the .oldvalue is not changing..Is there any way to make this happen. I am attaching a sample db with this. If someone can clear this please update the db or show me the code to do that.....


Thanks in advance


Thanks
 

Attachments

You would have to create an unbound text box and store the previous value there using the AfterUpdate event of the combo box in question. Then update and/or reference the unbound text box when needed. You will have to play around and test this one until you get it right.
 
Putten, here is the code that worked on your database after I downloaded it. Notice there is only 1 extra line of code at the end of what you already had.

Private Sub Table2_itemid_AfterUpdate()
Me.prev_itemid = Me.Table2_itemid.OldValue
Me.prev_fruit = Me.fruit1
Me.fruit1.Value = Me.fruit
Me.color1.Value = Me.color
DoCmd.RunCommand acCmdRefresh
End Sub

I have attached a working copy of your database for you.
 

Attachments

Hi godo,

Thanks and reply and the sample db. That worked very well ......



Thanks again

Thanks
 

Users who are viewing this thread

Back
Top Bottom