Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need to generate sequential numbers

Status
Not open for further replies.

martakeithy

Technical User
Nov 12, 2001
19
GB
Hi
I have tried the Access SQL forum, but to no avail so I'm trying this forum, if I'm in the wrong place I do aplogise.

I am working on a quiz database and one of my tables holds a question and its related answers, I need a method by which I can number questions sequentially as they are entered 1,2,3... etc.
I am using an autonumber field as its primary key and of course the numbers that this generates are of no use, as they are non-sequential.
I have been informed that there is a property which can be used to generate sequential numbers like this?
Does anyone have any suggestions as to how I can achieve this?
Thank you
Marta
 
How do you want to view this. On a report or in a query
 
Go to design view of the table, select the Autonumber row, and in the properties box, change the New Values property from Random to Increment. Sean.
 
Hi
Thank you all for your helpful suggestions.
THe problem with the autonumber suggestion is that perhaps as a consequence of indexing with no repeats, very few of my tables begin at 1.
I am entering the data from an asp form. I thought that if I entered to data into a query which has an autoincrementing field that I could stick the value generated into a field called question number for each new record.
Unfortunately DMax gives me the highest primary key value, which is higher than the actual number of records. I have written the same thing with DCount instead and it returns the number of records. Is it possible to now assign the total number of records + 1 to each new record entered. I anticipate only single entry of records.
Any ideas??
Regards
Marta
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top