How does a combo box selection populate a sub form

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a form with a sub form and a combo box. I want the user to be able to
select a word from the combo box and have the sub form populate with the
appropriate fields depending on the combo box selection.
 
For ths I am considering you have a combo with specifics word (and not from
table) and you have one subform for each group of data:
In your combo:

Combo.RowSourceType = "Value List"
Combo.RowSource = 'Word 1';'Sub Form1';'word 2';'Sub Form2';'Word 3';'Sub
Form 3'
Combo.BoundColumn = 1
Combo.LimitToList = Yes
Combo.ColumnCount = 2
Combo.ColumnWidths = 1";0"

Private Sub Combo2_AfterUpdate()
Child.SourceObject = Combo.Column(1)
End Sub

Change the COMBO for the name of your combobox
Change Word 1, Word 2 for your words
Change Sub form 1, Sub form2 for the names of your Sub Forms
Change Child for the name of your subform

I hope it helps !

Mauricio Silva
 
Back
Top