Read specific Column of a Table

  • Thread starter Thread starter Graham
  • Start date Start date
G

Graham

Hi, I had the After Update Event of a Combobox working correctly, displaying
values from separate tables in a second combo. However, now that I’ve added a
primary key to my separate tables, it isn’t working. I presume that it’s now
reading the Primary Key in Column 1, rather than the data that’s now in
Column 2. How do I amend the code below to make it read Column 2 of the
respective tables ? Many Thanks


Private Sub cboResource_AfterUpdate()
On Error Resume Next
Select Case Me.cboResource
Case "System Engineering Services"
cboCapability.RowSource = "tblSESCapabilty"
Case "Management Services"
cboCapability.RowSource = "tblMSCapability"
Case "Specialist Services"
cboCapability.RowSource = "tblSSCapability"
End Select

End Sub
 
Change
Select Case Me.cboResource
To
Select Case Me.cboResource.Column(1)

That will read column 2 of the combobox - column numbers start with zero
--
John Spencer
Access MVP 2002-2005, 2007-2008
Center for Health Program Development and Management
University of Maryland Baltimore County
..
 
Back
Top