I'm using a combo box to make some fields visible or invisible and I can't figure out how to specify a column by its header name instead of by using its column number. Here's what I have that works partially:
Private Sub Sample_Description_AfterUpdate()
If [Sample Description].Column(1) = "-1" Then
Me.[125000].Visible = True
Else
Me.[125000].Visible = False
End If
End Sub
But since the info in the columns may be changed in the future, since they reference a data sheet that may be altered down the road, I want to specify the column header which is "125000mm" so it would look like this, although this example obviously wouldn't work since I made this up to show what I'm attempting to accomplish.
Private Sub Sample_Description_AfterUpdate()
If [Sample Description].ColumnHeader[125000mm] = "-1" Then
Me.[125000].Visible = True
Else
Me.[125000].Visible = False
End If
End Sub
I hope I've been clear.