[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 264
  • Last Modified:

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

  • 2
1 Solution
Alan WarrenCommented:
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 WarrenCommented:
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)


Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now