TxtBox = unbound locked, disabled list box

We have a unbound field, cbobase_kpi that is controlled by a query.  Code:

Private Sub cboSub_Skillset_AfterUpdate()
Me.cboSubSkillset.Value = Me.cboSub_Skillset.Value
Dim var As String

var = "Select [KPI] from BaseKPI where [Sub-Skillset]='" & Me.cboSub_Skillset & "'"
Me.cboBase_KPI.RowSource = var

Me.cboBase_KPI.Selected(0) = True
End Sub

We need to have our bound txt box, txtBaseKPI equal the value from cbobase_kpi.  

We have tried after updates, on click, and on change events with the following code.

Me.txtBaseKPI.value = Me.cbobase_kpi.value OR
Me.txtBaseKPI = Me.cbobase_kpi

We have tried to relate it as a variable.  We aren't getting any errors, just simply an empty null box.  

Help Please

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Alan WarrenApplications DeveloperCommented:
Hi AdLiz,

After you reset the rowsource for the combo is the combo populated with a value?

Me.txtBaseKPI = Me.cbobase_kpi.column(0)


lizzy121202Author Commented:
In resetting the rowsource, a value does appear in the box, however to get the code to work appropriately for the auto-population, we had to change the box from a combo box to a list box.

Unfortunately, the code you have supplied does not work.

Any other ideas?

Alan WarrenApplications DeveloperCommented:
Hi AdLiz

is the control still called cbobase_kpi or did you rename it?

     ControlName.Column(index) should still work with a listbox.

listboxes and comboboxes are zero based so the the first column is referred to as column(0)


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.