FizzyFish
Registered User.
- Local time
- Today, 11:31
- Joined
- Jun 16, 2006
- Messages
- 26
I have an unbound form which contains a listbox and two combo boxes. The combo boxes have a rowsource from a SQL Server stored procedure, while the list box is filled by passing the contactid to the form and then created a query string as the rowsource. So far all of this works fine.
Now here is where the problem is, when I click on a record in the list box I want the combo boxes to be set to the column(6) and Column(7) of the list box, respectively. The columns contain the IDs that are the first value of the columns in each of the comboboxes.
When I step through the code the values are appear to be there but the combo box remains blank. I've check the column widths of the combo boxes and they are correct, so it's not a question of a zero length column.
Any ideas on how to make this work is greatly appreciated. Below is the code for populating the combo boxes from the Listbox.
Private Sub lstResults_Click()
Me.cboOne.TAG = Me.lstResults.Column(0)
Me.cboOne.Value = Me.lstResults.Column(6)
Me.cboTwo.SetFocus
Me.cboTwo = Me.lstResults.Column(7)
Me.txtOne = Me.lstResults.Column(3)
Me.txtSortOrder = Me.lstResults.Column(4)
Me.cboOne.SetFocus
End Sub
Now here is where the problem is, when I click on a record in the list box I want the combo boxes to be set to the column(6) and Column(7) of the list box, respectively. The columns contain the IDs that are the first value of the columns in each of the comboboxes.
When I step through the code the values are appear to be there but the combo box remains blank. I've check the column widths of the combo boxes and they are correct, so it's not a question of a zero length column.
Any ideas on how to make this work is greatly appreciated. Below is the code for populating the combo boxes from the Listbox.
Private Sub lstResults_Click()
Me.cboOne.TAG = Me.lstResults.Column(0)
Me.cboOne.Value = Me.lstResults.Column(6)
Me.cboTwo.SetFocus
Me.cboTwo = Me.lstResults.Column(7)
Me.txtOne = Me.lstResults.Column(3)
Me.txtSortOrder = Me.lstResults.Column(4)
Me.cboOne.SetFocus
End Sub