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

When the value in a combo box is changed record change in a separae field

P: 1
Using Access 2010.
I have a combo Box with 3 possible Values "Newstarter","Client" and "Paye"

If the current value changes from "Newstarter" to "Client"
I want to record the change in a text field [fldChange] ie
"Status changed from Newstarter to Client on Date()"
Similarly if a change is made to Paye.

I have very limited VB experience and would hope that I could use a Macro.
Feb 26 '14 #1
Share this Question
Share on Google+
1 Reply

P: 294
You can create a TextBox on the form.

In the text box, put
Expand|Select|Wrap|Line Numbers
  1. =[YourCombo].[Column](1)
If you want to compare two values in your combobox and display them in the text box, your code would be required to go into VBA on the BeforeUpdate because you're comparing .OldValue and .Value. My best guess, if it is possible, is to store Combobox.OldValue and .Value in variables and use them like this.

I am not sure of how to retrieve the Column(1).OldValue, as I kept receiving errors.

The Column(1) is going to give you the text representation on the field you've chosen, instead of the "ID".

Expand|Select|Wrap|Line Numbers
  1. TestTxt = " Status changed from " & .OldValue & " to "
  2. & .Value.
Feb 26 '14 #2

Post your reply

Sign in to post your reply or Sign up for a free account.