Ascending order on my search form?

DeanRowe

Registered User.
Local time
Today, 17:17
Joined
Jan 26, 2007
Messages
142
hi,

I have created a search form based on a table, and a macro to show a list of my customers. If you press "C" it only shows customers whose surnames begin with C.

However I've really been struggling with how to filter the names into alphabetical order as well.

For example, the following names:

Cliff
Cooke
Chapman
Crosland
Clare
Curtis

appear in this order, but I want them to appear alphabetically. I can't figure it out and I've spent ages trying!

Would anyone mind taking a look at it for me please?

Thank you.

Dean
 

Attachments

Dean

There are a couple of simple ways.

Firstly, make a Select Query on your table and have it sort Customer Surname as ascending order. You will see how to do that on the query grid. Edit. Forgot, base your form on this query ie the query is the form's data source.

Another way is to add to action lines to your macro......make sure you do this above where you have StopMacro.

The action you want is GoToControl. Down the bottom of the macro design screen enter Customer Surname.

For the next action line you want RunCommand. Click on the box down the bottom and you will see a drop down list. You want Sort Ascending. That will run when you click one of your alpha buttons. You could also have those two action lines as a separate macro that runs on the form event for Open.

I would sugges that to play around with what you have that you add a few names that start with a letter other than C
 
Last edited:
A very quick way would be to open the form in design view, and type this in (EXACTLY AS SHOWN) the ORDER BY property:

[Customer Surname],[Customer First Name]
 
bob that worked a treat for me also

thank you

rob :D
 

Users who are viewing this thread

Back
Top Bottom