Field List Combo boxes

K

Kate Williams

I want to use a field list combo box to slect various Skill Headings - I
want to exclude the fist couple of field headings as these are record
identifiers (Name and ID Number etc.) I know I can use a query to do
this but was wondering if there is a way to automate - The Field
heading relate to Skill headings on a Skill Level Matrix and will often
change. This database will ultimately have to be maintained by someone
who's not that great with access - so another set of queries to update
isn't really what I want.
 
D

Duane Hookom

I wouldn't go any further if you have skill names as column/field names.
Using data values as field names suggests an un-normalized table structure.
A normalized structure would provide a very simple solution to your
question.

However, if you really need to do this try the following code that assumes
you create a dummy, invisible combo box "cboInvisible" with a row source of
your table. The combo box "cboEmployeeFields" will get the 3rd to last
fields from the invisible combo box.

Private Sub Form_Open(Cancel As Integer)
Dim cboSource As ComboBox
Dim cboTarget As ComboBox
Dim intField As Integer
Set cboSource = Me.cboInvisible
Set cboTarget = Me.cboEmployeeFields
cboTarget.RowSource = ""
For intField = 2 To cboSource.ListCount - 1
cboTarget.AddItem cboSource.ItemData(intField)
Next
End Sub
 

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