Need Help to Create 1 A to Z Command Button (to sort - not filter)

D

DMD

I am using MS Access 2000

In the footer of my form, I would like to create a command button that
will sort my City field from A to Z. I know that you can put the
cursor in any field and use the A-Z or Z-A sort buttons on the menu
bar. However, it will be easier for my end user to use a button that
says "Sort City."

I know how to use the A to Z buttons option Group provided by the
sample Northwind.mdb. You can filter by individual letters but no A to
Z sort is available.

Thanks in advance for your help.
 
F

fredg

I am using MS Access 2000

In the footer of my form, I would like to create a command button that
will sort my City field from A to Z. I know that you can put the
cursor in any field and use the A-Z or Z-A sort buttons on the menu
bar. However, it will be easier for my end user to use a button that
says "Sort City."

I know how to use the A to Z buttons option Group provided by the
sample Northwind.mdb. You can filter by individual letters but no A to
Z sort is available.

Thanks in advance for your help.

Code the Click event of your command button:
Me.OrderBy = "YourTableName.[City]"
Me.OrderByOn = True

Do you know how to remove the sort?
 
N

nytwodees

Hi Fred:

Thanks for the code. I will try it in the morning at work.

No, I do not know how to remove the sort. I could use your help here as well!

BTW, do you know how to create sequential filtering? For example a button to
first filter by "City" followed by a 2nd button that will filter records for
that city "Street Names" beginning with "S."

Thanks again for your time, knowledge, and effort!


Dan
fredg said:
I am using MS Access 2000

In the footer of my form, I would like to create a command button that
will sort my City field from A to Z. I know that you can put the
cursor in any field and use the A-Z or Z-A sort buttons on the menu
bar. However, it will be easier for my end user to use a button that
says "Sort City."

I know how to use the A to Z buttons option Group provided by the
sample Northwind.mdb. You can filter by individual letters but no A to
Z sort is available.

Thanks in advance for your help.

Code the Click event of your command button:
Me.OrderBy = "YourTableName.[City]"
Me.OrderByOn = True

Do you know how to remove the sort?
 

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