Sort Combo Box

J

JimS

I have a combo box I populate at form open time with the names of all forms
from the allforms collection. Is there a good way to sort this row source
list after populating it, or do I need to put it into an array, sort it, then
populate the row source?
 
J

John W. Vinson

I have a combo box I populate at form open time with the names of all forms
from the allforms collection. Is there a good way to sort this row source
list after populating it, or do I need to put it into an array, sort it, then
populate the row source?

I'd base the combo box on a Query; you can even base it on a query of the
hidden MSysObjects() table, and avoid using any code at all:

SELECT MSysObjects.Name
FROM MSysObjects
WHERE (((MSysObjects.Type)=-32768))
ORDER BY MSysObjects.Name;

Note that this (along with Allforms) will include in the list forms whose only
use is as a subform... not necessarily a good thing to present to the users!
 
J

JimS

Couple of bits of good news...
I found a similar post after posting the question, and had already
implemented the query.

I use careful naming conventions, so I can eliminate any form whose name
starts with "sfm" if I want. This particular application is a security group
membership situation, so sfm's may belong in it. I haven't decided yet.

Thanks, John, for your help. I really appreciate knowing you guys are
always there for me.
 

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