Hi, Richard.
If you have a primary key on the table or a unique index, then you could use
two queries to do the update for you. It doesn't matter if this column is
numeric or not or even non-sequential. Try:
First query:
SELECT ID,
IIF((((SELECT COUNT(*)
FROM tblMyTable AS Cnt
WHERE Cnt.ID < tblMyTable.ID) + 1) MOD 2) = 1, "Odd", "Even") AS OddOrEven
INTO tblNumbering
FROM tblMyTable;
Second query:
UPDATE tblMyTable AS T INNER JOIN tblNumbering AS N ON T.ID = N.ID
SET SomeValue = OddOrEven
.. . . where the table is named tblMyTable, ID is the primary key or unique
index, and SomeValue is the name of the field that needs "Even" or "Odd."
HTH.
Gunny
See
http://www.QBuilt.com for all your database needs.
See
http://www.Access.QBuilt.com for Microsoft Access tips.
(Please remove ZERO_SPAM from my reply E-mail address so that a message will
be forwarded to me.)
- - -
If my answer has helped you, please sign in and answer yes to the question
"Did this post answer your question?" at the bottom of the message, which
adds your question and the answers to the database of answers. Remember that
questions answered the quickest are often from those who have a history of
rewarding the contributors who have taken the time to answer questions
correctly.