PC Review


Reply
Thread Tools Rate Thread

Automatic incremental of records

 
 
=?Utf-8?B?bmpvZ3Vz?=
Guest
Posts: n/a
 
      17th Jul 2007
I have a table with several records and arranged serially, i.e 1,2,3 .....25.
When I delete arecod like record number 3 I would like record number 4 to
become record number 3. But in my case Record number 4 still remains serial
number 4 although it is actually the third record. Is there a way it can be
done automatically?
 
Reply With Quote
 
 
 
 
=?Utf-8?B?c2N1YmFkaXZlcg==?=
Guest
Posts: n/a
 
      17th Jul 2007
As far as I am aware, the answer is no. Anyway, why would you want to?



"njogus" wrote:

> I have a table with several records and arranged serially, i.e 1,2,3 .....25.
> When I delete arecod like record number 3 I would like record number 4 to
> become record number 3. But in my case Record number 4 still remains serial
> number 4 although it is actually the third record. Is there a way it can be
> done automatically?

 
Reply With Quote
 
=?Utf-8?B?bmpvZ3Vz?=
Guest
Posts: n/a
 
      17th Jul 2007
I want to maintain seniority of the people in those records even after I
delete a person the person should replace ther deleted one in that order.
Those serial numbers, how should I assign the people numbers 1,2,3....50 and
the numbers to update themselves automatically?

"scubadiver" wrote:

> As far as I am aware, the answer is no. Anyway, why would you want to?
>
>
>
> "njogus" wrote:
>
> > I have a table with several records and arranged serially, i.e 1,2,3 .....25.
> > When I delete arecod like record number 3 I would like record number 4 to
> > become record number 3. But in my case Record number 4 still remains serial
> > number 4 although it is actually the third record. Is there a way it can be
> > done automatically?

 
Reply With Quote
 
=?Utf-8?B?c2N1YmFkaXZlcg==?=
Guest
Posts: n/a
 
      17th Jul 2007

I made the assumption you were asking about a primary key. If you are, then
I wouldn't consider it to be wise to use the primary key for information on
seniority of people especially if you have foreign keys. Then there are data
integrity problems.

Having said "no" there is a solution.

What I have done is create a form with an unbound text box and a command
button that will run two queries

Delete query:

In the criteria write a reference to the text box
[forms]![form name]![field name]

Update query:

In the "update" row write [form name] - 1
In the criteria row write: >[forms]![form name]![field name]

this works.

I will add you may (or should) be able to run these two queries using the
"on delete" event in the form. Then use me.refresh or me.requery.

"njogus" wrote:

> I want to maintain seniority of the people in those records even after I
> delete a person the person should replace ther deleted one in that order.
> Those serial numbers, how should I assign the people numbers 1,2,3....50 and
> the numbers to update themselves automatically?
>
> "scubadiver" wrote:
>
> > As far as I am aware, the answer is no. Anyway, why would you want to?
> >
> >
> >
> > "njogus" wrote:
> >
> > > I have a table with several records and arranged serially, i.e 1,2,3 .....25.
> > > When I delete arecod like record number 3 I would like record number 4 to
> > > become record number 3. But in my case Record number 4 still remains serial
> > > number 4 although it is actually the third record. Is there a way it can be
> > > done automatically?

 
Reply With Quote
 
Joseph Meehan
Guest
Posts: n/a
 
      17th Jul 2007
njogus wrote:
> I have a table with several records and arranged serially, i.e 1,2,3
> .....25. When I delete arecod like record number 3 I would like
> record number 4 to become record number 3. But in my case Record
> number 4 still remains serial number 4 although it is actually the
> third record. Is there a way it can be done automatically?


Tables do not have a sequencial order. It is more of a bucket of data.
You need to provide a method of sorting. Since it appears you want
seniority order, then all you need is a field listing order or date/time of
seniority and sort on that field when you display the data in a query, form
or report.

--
Joseph Meehan

Dia 's Muire duit



 
Reply With Quote
 
=?Utf-8?B?bmpvZ3Vz?=
Guest
Posts: n/a
 
      19th Jul 2007
Thanks, I like the idea you've given me. As a novice I've created the Delete
and Update queries. The problem though is about the form; will the form
include fields from a certain table or query? And how can one Command Button
run two queries? How do I make it possible.
What is this 'on delete' event how is it done?

"scubadiver" wrote:

>
> I made the assumption you were asking about a primary key. If you are, then
> I wouldn't consider it to be wise to use the primary key for information on
> seniority of people especially if you have foreign keys. Then there are data
> integrity problems.
>
> Having said "no" there is a solution.
>
> What I have done is create a form with an unbound text box and a command
> button that will run two queries
>
> Delete query:
>
> In the criteria write a reference to the text box
> [forms]![form name]![field name]
>
> Update query:
>
> In the "update" row write [form name] - 1
> In the criteria row write: >[forms]![form name]![field name]
>
> this works.
>
> I will add you may (or should) be able to run these two queries using the
> "on delete" event in the form. Then use me.refresh or me.requery.
>
> "njogus" wrote:
>
> > I want to maintain seniority of the people in those records even after I
> > delete a person the person should replace ther deleted one in that order.
> > Those serial numbers, how should I assign the people numbers 1,2,3....50 and
> > the numbers to update themselves automatically?
> >
> > "scubadiver" wrote:
> >
> > > As far as I am aware, the answer is no. Anyway, why would you want to?
> > >
> > >
> > >
> > > "njogus" wrote:
> > >
> > > > I have a table with several records and arranged serially, i.e 1,2,3 .....25.
> > > > When I delete arecod like record number 3 I would like record number 4 to
> > > > become record number 3. But in my case Record number 4 still remains serial
> > > > number 4 although it is actually the third record. Is there a way it can be
> > > > done automatically?

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Weekly Automatic Backup not updating incremental changes mottersuk Windows Vista Performance 0 29th Nov 2007 10:54 PM
automatic incremental counter =?Utf-8?B?SnVkeUlBQVA=?= Microsoft Word Document Management 5 17th May 2007 01:46 PM
Create weekly incremental dates and add records Pragv Microsoft Access 4 5th Sep 2006 01:00 AM
Automatic Incremental Decimal Numbering =?Utf-8?B?QW5kcmV3?= Microsoft Excel Misc 0 18th May 2006 08:40 PM
Re: Automatic Incremental Search Roger Carlson Microsoft Access Form Coding 0 10th Mar 2004 03:57 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:10 PM.