Sort on a form?

J

Jackmac

Hi all,

Hopefully an easy one for somebody...

I've created an input form for users to type in data about customer sales
etc. They also use it when the customer calls to ask a question. At the
moment the database (and therefore the form) shows the data as being sorted
on the autogenerated ID number which is the primary key. I want to put a
button on the form so they can sort it in order of say Name, Postcode etc.
Any ideas how?

TIA

Jack
 
W

Wayne-I-M

I assume you have a continous form

Above each "coloum" place a label in the form's header.

So if you had a control called txtName you would have a lable called lbeName.
etc

Put this OnClick of the Lable

Private Sub lbeName_Click()
Me.OrderBy = "[txtName]"
Me.OrderByOn = True
End Sub
 
F

fredg

Hi all,

Hopefully an easy one for somebody...

I've created an input form for users to type in data about customer sales
etc. They also use it when the customer calls to ask a question. At the
moment the database (and therefore the form) shows the data as being sorted
on the autogenerated ID number which is the primary key. I want to put a
button on the form so they can sort it in order of say Name, Postcode etc.
Any ideas how?

TIA

Jack

Actually you don't need any special additional command button to do
this if you are using the standard built-in Tool bars.

All the user need do is select the field, i.e. the [LastName] field,
then click the A-Z or Z-A tool button.
To remove the sort, right-click on the form and select Remove
Filter/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