Read specific Column of a Table

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
 
J

John Spencer

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
..
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top