How to fill a Column with repeating sequence till full using query or vba

Exi

Registered User.
Local time
Today, 22:17
Joined
May 1, 2017
Messages
23
I have a table with ID, and PositionID
ID is Autonumber and PositionID is Number.
ID is linked to another table of Records
There is currently 3625 records in ID
so HOW do I fill PositionID with the Number sequence of 1 to 10 repeating over and over till the last record and save to a temp table using a query or vba, so as More titles are added I can regenerate a new table of PositionID
Hope this makes sense.:banghead:
 
What exactly are you trying to do and why --in business terms?
What does the table represent? Give tables and fields meaningful names.
 
The "syntax" answer is, if you want repeating 1 to 10 perhaps because you are selecting this in another query, you can forget about storing the repeating sequence and instead use

Code:
SELECT ID, ..., ( ID MOD 10 ) + 1, ... FROM whatever else goes here... ;

Since this number is computable from another field, our usual advice is to NEVER store it, but just always compute it in a SELECT query and use THAT as your record source.
 
awesome worked a treat
Thanks a million
 

Users who are viewing this thread

Back
Top Bottom