Sorting Records in a Form

R

richard

Hi

I have a form which enters data into a table. I am struggling to get the
data when viewed in the form to show in ascending order on one of the fields
in the table. I have sorted the table so that when the table is viewed it is
sorted by the particular field. However the form still shows the records is a
mixed order.
I have also tried looking at the properties of the form and set the 'order
by' property to the field required but again this did not work.
Any help please

Richard
 
A

Allen Browne

Create a query.
Set the sorting in the query.
Then set the RecordSource property of your form to this query.

To get the form's OrderBy property to work, you must programmatically set
its OrderByOn property to True in the Open event of the form.
 
L

Linq Adams via AccessMonster.com

Allen's advice is, of course, correct! You said you had "sorted the table so
that when the table is viewed it is sorted by the particular field." And
that's exactly what you did; sorted the table so when **viewed** in table
view it was sorted! This doesn't actually change the order of records in the
table, which is what your form is based on. In fact, nothing changes the
order of records in a table! They always remain in the order that they're
entered. As someone here often says, John Vinson perhaps, a table is just a
bucket of jumbled data, with no rhyme or reason. This is the reason that even
a simple form based on a single table should actually be based on a query
based on that one table.

--
There's ALWAYS more than one way to skin a cat!

Answers/posts based on Access 2000/2003

Message posted via AccessMonster.com
 

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