Inserting a new row between existing rows (1 Viewer)

bnw

Registered User.
Local time
Today, 05:32
Joined
Sep 19, 2006
Messages
26
To Whom It May Concern

I would like to know how can I insert a new row between an existing row in an Access Table

For example,

I want to insert a new row between line number 122 and 123. Do I need to get rid of the primary key or change it to Number. What I am doing now in order to have several topics group together on a report such as "Activities Topic" and a Date field for that topic. However, there are various topics under the Activities topic. Each new information that is being updated for this topic I have to reorder the number by the topic name in the Order field so that the date will be in chronoligal order in the report.

Is there a better way in do this?:confused:
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 07:32
Joined
Feb 28, 2001
Messages
27,001
You must stop immediately and forever in thinking "rows" when working with Access. They are not rows. They are just drawn that way. (With apologies to Jessica Rabbit in Who Framed Roger Rabbit)

If you have records with prime keys 123 and 124 and they are integers, you cannot put anything between them. PERIOD. To allow yourself the luxury of putting things helter-skelter on a display, you need to either be preprared to renumber things frequently or put a secondary key on the table so that your key is comprised of two parts. Then use the second part to force order to be a certain way.

The better way to do this is to forego the idea of forcing a particular order. Use natural identifiers. Then let the data fall where it falls. Your issue is that Access is NOT A SPREADSHEET. You don't get to set the order. The data itself sets its own order. For you to set the order - or to NEED to set the order, it implies that you have designed something incorrectly.

Google search "Database Normalization" and look at the .EDU site articles plus any vendor-based articles from vendors you trust. Access also has help on the subject of normalization.

Once your dataset is properly normalized, it will fall into its own place so that you don't have to bang on it to make it fit. (A.k.a. percussive engineering - the only time that a programmer legitimately uses a hammer.)
 

Users who are viewing this thread

Top Bottom