Sort from Combo Box

  • Thread starter Thread starter Damon Johnson
  • Start date Start date
D

Damon Johnson

Hi All,

Office XP Pro on WinXP Pro

I want to have a combo box on a form that list several
of the form field names. I then want to be able to
select the field name from the combo box then have the
form sort the records by the field name I've selected.

How can I make this happen?

Much thanks,
Damon Johnson
 
Damon,
To show ALL of the fields in a combo box, set the Combo's
RowSourceType property to Field List.
Then select the table wanted in the RowSource property.

Code the Combo's AfterUpdate event:

Me.OrderBy = Me!ComboName
Me.OrderByOn = True

To show just a few selected field names in the combo box,
change the RowSourceType property to Value List.
Set the RowSource to:
FieldA;FieldD;FieldX
 
Back
Top