Incrementing a column based on number of rows

newbie87

Registered User.
Local time
Today, 15:13
Joined
Sep 9, 2011
Messages
43
Hi All,

I have a table which has the columns, ID, ForeName, Surname, Age, Entry

I need the Entries column to increment depending on how many entries a user has created, for example.
Code:
ID      ForeName         Surname      Age        Entry
1         Dan           Jones         21            1
2         Dan           Jones         21            2
3         Dan           Jones         21            3
At the moment the entry columns says 1 for all rows, how can i write an update query to say, if the same person has more than one entry, increment Entry by 1?

I know i could write an If statement to say if the row exists +1 to Entry, but i've been asked to set it out this way.

Any help would be appreciated.
 
Perhaps the attached sample will give you some pointer. It certainly should be adaptable to your purposes.
 

Attachments

Many thanks for your response, let me just explain a little further what im doing.

I have a text file that i insert into my Access table, there a thousands of rows in this file, so i have written an update query using the Query wizard. Everything works fine, i just need to programme that if an entry appears more that once, increment the entry column by one.

I dont want to use vba code behind, i need to use the update query wizard, is it possible to do it this way?
 
Probably, but it will be easier to do it using a variation on the code presented in the sample.
 

Users who are viewing this thread

Back
Top Bottom