FizzyFish
Registered User.
- Local time
- Today, 11:45
- Joined
- Jun 16, 2006
- Messages
- 26
I've created an unbound form with a list box and two combo boxes.
The list box is multi-columns and contains the Primary Keys of the two combo boxes row sources. First column in each of the combo boxes is the primary key and has a zero width so they don't show.
So here is the problem, I have written code for the On-Click event of the list box to populate the keys to each of the combo boxes. When I step through the code and I can see that the keys have been assigned to the combo boxes but the column values are not showing. What am I doing wrong? Is it because the form is unbound? I wouldn't think this would matter since I am populating the combo boxes not the form recordsource.
Anyway here is the code. Any insight is greatly appreciated.
Private Sub lstResults_Click()
Me.cboOne.TAG = Me.lstResults.Column(0)
Me.cboOne.SetFocus
Me.cboOne = 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
The list box is multi-columns and contains the Primary Keys of the two combo boxes row sources. First column in each of the combo boxes is the primary key and has a zero width so they don't show.
So here is the problem, I have written code for the On-Click event of the list box to populate the keys to each of the combo boxes. When I step through the code and I can see that the keys have been assigned to the combo boxes but the column values are not showing. What am I doing wrong? Is it because the form is unbound? I wouldn't think this would matter since I am populating the combo boxes not the form recordsource.
Anyway here is the code. Any insight is greatly appreciated.
Private Sub lstResults_Click()
Me.cboOne.TAG = Me.lstResults.Column(0)
Me.cboOne.SetFocus
Me.cboOne = 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