TxtBox = unbound locked, disabled list box

Posted on 2004-11-16
Last Modified: 2011-08-18
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

Question by:lizzy121202
    LVL 26

    Expert Comment

    by:Alan Warren
    Hi AdLiz,

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

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



    Author Comment

    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?

    LVL 26

    Accepted Solution

    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)


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to improve team productivity

    Quip adds documents, spreadsheets, and tasklists to your Slack experience
    - Elevate ideas to Quip docs
    - Share Quip docs in Slack
    - Get notified of changes to your docs
    - Available on iOS/Android/Desktop/Web
    - Online/Offline

    Suggested Solutions

    This article explains all about SQL Server Piecemeal Restore with examples in step by step manner.
    Shadow IT is coming out of the shadows as more businesses are choosing cloud-based applications. It is now a multi-cloud world for most organizations. Simultaneously, most businesses have yet to consolidate with one cloud provider or define an offic…
    Video by: Steve
    Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
    Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

    737 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now