Sort from Combo Box

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
 
F

Fredg

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
 

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

Similar Threads


Top