UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
 
   Reply to this topicStart new topic
> Bound Combox .oldvalue, Access 2013    
 
   
soggycashew
post Sep 14 2019, 03:26 PM
Post#1



Posts: 354
Joined: 23-April 13
From: WV, USA


Hello, I have a Bound combo box on my form. In the before update I'm wanting to display a message box that shows the last value that was selected. I tried

CODE
Dim strOldProd as string

strOldProd = me.cboProduct.Column(1).OldValue

Msgbox "Changing from " & strOldProd
Go to the top of the page
 
theDBguy
post Sep 14 2019, 03:40 PM
Post#2


Access Wiki and Forums Moderator
Posts: 76,381
Joined: 19-June 07
From: SunnySandyEggo


Hi. If your combobox is bound to an ID field, you might try using DLookup() to grab the value from the display column.

--------------------
Just my 2 cents... "And if I claim to be a wise man, it surely means that I don't know" - Kansas
Access Website | Access Blog | Email
Go to the top of the page
 
soggycashew
post Sep 14 2019, 09:00 PM
Post#3



Posts: 354
Joined: 23-April 13
From: WV, USA


I figured it out... My forms controlsource was a table so I created a query. I then hid a textbox (txtOldProduct) that held the value and referenced it.


CODE
Dim strOldProd As String

strOldProd = Me.txtOldProduct

Msgbox "Changing from " & strOldProd


Thanks DB
This post has been edited by soggycashew: Sep 14 2019, 09:24 PM
Go to the top of the page
 
theDBguy
post Sep 14 2019, 10:29 PM
Post#4


Access Wiki and Forums Moderator
Posts: 76,381
Joined: 19-June 07
From: SunnySandyEggo


Hi. Glad to hear you got it sorted out. Good luck with your project.

--------------------
Just my 2 cents... "And if I claim to be a wise man, it surely means that I don't know" - Kansas
Access Website | Access Blog | Email
Go to the top of the page
 


Custom Search


RSSSearch   Top   Lo-Fi    16th October 2019 - 09:21 AM