No Order on Tables

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a form that generates a report. When the "Generate" command button is
pressed, a report is generated based on a table. This table, we'll call it
tblGen, is constructed from records from various other tables via SQL
statements.

Is there a way for me to have these records listed in tblGen in the order
that I place them from other tables? It seems that no matter what I do,
tblGen needs to sort based on something (IDs, FirstName, etc...). Is there a
way to remove this sort and just list the records as I add them? Or is there
perhaps a different method of achieving the same effect on the report?

Many thanks for your help in advance.

Joe
 
I suggest that you base the report on a query instead of a table. You can
base the query on the table and put in the sort order that you want.
 
Kurt, thank you for your response. But I believe I'll still face the same
problems with a query. I do not want to place records in a sort order. I
want to be able to deliberately place them out of order. The report I'm
building is actually an exam, and each record is a question. As such, I
would like to be able to place questions in an order of my choosing that does
not boil down to a sort order (even a hierarchical one).
 
You'll need to add a field you can use to sort the query on. You can't rely
on any order in a table. Part of the definition of a 'relation' (the term
used in relational theory for what we commonly call a 'table') is that it is
'an unordered set of data'. Of course, any set of data will always be in
*some* order, but the point is that you can not depend on any specific order
in the table. You need to explicitly order the data in your query or SQL
statement, and if there isn't an existing field or field that you can use to
order it, you need to add one.

You could use an incrementing AutoNumber to sort records in the order in
which they were entered, but then you'll have problems if you miss something
and have to go back and enter it later. It may be better to add a
non-AutoNumber 'QuestionNumber' field that you can edit as necessary.

--
Brendan Reynolds (MVP)
http://brenreyn.blogspot.com

The spammers and script-kiddies have succeeded in making it impossible for
me to use a real e-mail address in public newsgroups. E-mail replies to
this post will be deleted without being read. Any e-mail claiming to be
from brenreyn at indigo dot ie that is not digitally signed by me with a
GlobalSign digital certificate is a forgery and should be deleted without
being read. Follow-up questions should in general be posted to the
newsgroup, but if you have a good reason to send me e-mail, you'll find
a useable e-mail address at the URL above.
 
I do the same, I usually call the column something like "rank".

I also have a form that populates the rank column with values in increments
of 10 when the user presses a "renumber" button. The user can then update
the rank column with values of their choice (like 11 or 31 or whatever number
they wish) and press a "sort" button, which requeries, putting in the order
of rank, thus allowing users to order them as they wish by assigning numbers
to the rank column.

They can press "renumber", loading the column with the values in increments
of 10 again, retaining the order that they dictated, and they can repeat this
as often as it takes to get the desired order. That way, they can easily
change the order to whatever they wish.

Hope this helps,
 
Back
Top