repeating sorting list

G

Guest

Ok, I have no code to show and no idea on how I would do this. I am writing
a database that will run a countinous form off of a query. I am adding in a
record that must be sorted based upon a field, and the record must be sorted
by very specific data.

For instance,

Mike is in the 1st and 14th record. In between there is another 13 records
(of course) with all different names. Now I need to add a new record in with
the name of Rachael, and because Rachael is not in any of the previous
records (1-14), Rachael's record has to be sorted so that it is one record
before Mike's last record (the new 14th record, moving Mike to 15).

That's the jist of the deal I need, and I hope I explained it properly. I
have no records and no real tables built so if anything needs to be added, I
can add it.

Any Suggestions would be GREATLY appreciated!!!
 
J

Joseph Meehan

Broadway said:
Ok, I have no code to show and no idea on how I would do this. I am
writing a database that will run a countinous form off of a query. I
am adding in a record that must be sorted based upon a field, and the
record must be sorted by very specific data.

For instance,

Mike is in the 1st and 14th record. In between there is another 13
records (of course) with all different names. Now I need to add a
new record in with the name of Rachael, and because Rachael is not in
any of the previous records (1-14), Rachael's record has to be sorted
so that it is one record before Mike's last record (the new 14th
record, moving Mike to 15).

That's the jist of the deal I need, and I hope I explained it
properly. I have no records and no real tables built so if anything
needs to be added, I can add it.

Any Suggestions would be GREATLY appreciated!!!

It is not clear how your table is designed.

Records in an Access table do not have an order. The order in which
they appear may change and does not always represent the order in which they
were entered.

You supply the information in the record that you can use to put the
records in order. That may be a new field or and existing field.

If you want names in an alphabetic order and you have a filed that has
the data you want to use for determining that order, you can tell a query,
report or form to display the data in alpha order based on that field. You
can also make more complex sorts and groupings.

You can also add a field and maybe just numbers to put your data in an
order manually. Using a non-integer number type you might want to use
something like:

1
2
3
3.4
3.9
4
etc.

This will allow you to add new records so they will fit in the middle or
the list, like adding one with 3.45 it will then appear as:

1
2
3
3.4
3.45
3.9
4

Does that help?
 
G

Guest

Joseph Meehan said:
It is not clear how your table is designed.

Records in an Access table do not have an order. The order in which
they appear may change and does not always represent the order in which they
were entered.

You supply the information in the record that you can use to put the
records in order. That may be a new field or and existing field.

If you want names in an alphabetic order and you have a filed that has
the data you want to use for determining that order, you can tell a query,
report or form to display the data in alpha order based on that field. You
can also make more complex sorts and groupings.

You can also add a field and maybe just numbers to put your data in an
order manually. Using a non-integer number type you might want to use
something like:

1
2
3
3.4
3.9
4
etc.

This will allow you to add new records so they will fit in the middle or
the list, like adding one with 3.45 it will then appear as:

1
2
3
3.4
3.45
3.9
4

Does that help?

First, Thanks for the FAST response.

Ok, I know what you mean, but it doesn't really help in this particular
situation. See, i can build the table to fit the programming I just haven't
done it yet. I need to have the data in the field sorted programmatically so
that all of the new data added, provided it doesn't have repeat information,
will be placed before any data that DOES have repeat information (see my
weird example in previous post!) I don't know how i would use numbers and
test for them yet. Got any ideas

As always, any help would be greatly appreciated.
 
J

Joseph Meehan

Broadway said:
First, Thanks for the FAST response.

Ok, I know what you mean, but it doesn't really help in this
particular situation. See, i can build the table to fit the
programming I just haven't done it yet. I need to have the data in
the field sorted programmatically so that all of the new data added,
provided it doesn't have repeat information, will be placed before
any data that DOES have repeat information (see my weird example in
previous post!) I don't know how i would use numbers and test for
them yet. Got any ideas

As always, any help would be greatly appreciated.

You always always build the tables first. Everything else depends on
the table design. Honest believe me and save yourself a lot of wasted time.
 
G

Guest

Joseph Meehan said:
You always always build the tables first. Everything else depends on
the table design. Honest believe me and save yourself a lot of wasted time.

Ok, so i built the table, basic design is based off of the person's name,
which is the only thing that has to be sorted. Still need to know how to
build a query so that a record will be placed before the 1st repeated record
in the set.
 
J

Joseph Meehan

Broadway said:
Ok, so i built the table, basic design is based off of the person's
name, which is the only thing that has to be sorted. Still need to
know how to build a query so that
a record will be placed before the
1st repeated record in the set.

Could you explain exactly what you mean by that? What is a repeated
record? What do you mean placed before? Access does not have records
before or after.
 
G

Guest

Joseph Meehan said:
Could you explain exactly what you mean by that? What is a repeated
record? What do you mean placed before? Access does not have records
before or after.


Ok,

I am trying to sort these records by the Name field, but the sort must be so
that if
the original order is

Mike
Rachael
Dominic
Harry
Mike

and I add a new record with the name Jack
then the new order will be

Mike
Rachael
Dominic
HarryMike
...

Also,
The sort has to maintain the original order
in other words

if the records have
Mike
Rachael
Dominic
Harry
Mike
Mike

and new records for Rachael and Harry are put in
then the new order would be
Mike
Rachael
Dominic
Harry
Mike
Rachael
Harry
Mike

so that the list if you think of the list as a place order like Mike is in
the 1st place and Rachael is in 2nd etc. the order of the list wouldn't change

Is that helpful at all? or just ramblings?
 
J

Joseph Meehan

Broadway said:
Ok,

I am trying to sort these records by the Name field, but the sort
must be so that if
the original order is

Mike
Rachael
Dominic
Harry
Mike

and I add a new record with the name Jack
then the new order will be

Mike
Rachael
Dominic
Harry
Mike
..

Also,
The sort has to maintain the original order
in other words

if the records have
Mike
Rachael
Dominic
Harry
Mike
Mike

and new records for Rachael and Harry are put in
then the new order would be
Mike
Rachael
Dominic
Harry
Mike
Rachael
Harry
Mike

so that the list if you think of the list as a place order like Mike
is in the 1st place and Rachael is in 2nd etc. the order of the list
wouldn't change

Is that helpful at all? or just ramblings?

Will I have to admit, I am a little confused. I can't make out what you
want.

If you have an order and if you add a field you can populate that field
with say incrementing numbers 1, 2, ... and you can sort on those numbers.
But if you want to add something in the middle you could do 1, 1.5, 2, ...

Is that what you want? You might want to use two or more sort fields if
you want to go back to the original order. I suggest you you start by
considering all the possible sort orders you might want in the future and
how you can identify them.

In all this keep in mind that you can NOT count on Access keeping
records in any specific order like you can Excel to keep rows in order.
 

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