Use Query to Sort Records in Input Form

K

Karl Burrows

I created a simple form for a group to track members in their interior
design society. The problem is the data in the table and form is in the
order the data was input. I would like for it to show in alphabetical
order. How do I create a query to drive the form that is used for input?

Thanks!
 
V

Van T. Dinh

You can base your Form on a Query that sort the Records according to the
order you want. The Query should have SQL String something like:

SELECT *
FROM [YourTable]
ORDER BY [LastName]
 
K

Karl Burrows

That was pretty easy! Thanks! I actually wanted it sorted by date, but it
worked out the same. I just built a query based on the same data that is in
the table and sorted the query by date. I didn't need to use a SQL string,
unless there is something that I don't know that will mess up my tables.

Van T. Dinh said:
You can base your Form on a Query that sort the Records according to the
order you want. The Query should have SQL String something like:

SELECT *
FROM [YourTable]
ORDER BY [LastName]

--
HTH
Van T. Dinh
MVP (Access)



Karl Burrows said:
I created a simple form for a group to track members in their interior
design society. The problem is the data in the table and form is in the
order the data was input. I would like for it to show in alphabetical
order. How do I create a query to drive the form that is used for input?

Thanks!
 
J

John Vinson

That was pretty easy! Thanks! I actually wanted it sorted by date, but it
worked out the same. I just built a query based on the same data that is in
the table and sorted the query by date. I didn't need to use a SQL string,
unless there is something that I don't know that will mess up my tables.

Just to clarify - a Query *IS* a SQL string. The query grid is just a
tool to ease the construction of SQL.

It's much easier to post SQL than to try to post the query grid - if
you see SQL posted, you can create a new Query, copy it into the SQL
window of the query (use the View menu option to open it), change the
table and fieldnames to match yours, and go to the query grid to see
how it looks. Similarly if you're having problems with a query you can
just post the SQL view; at this point it may look like gibberish but
those of us who have worked with it can read it with no problem.
 

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