Take not the name of thy Irish Pub or Taverna in vain.
:
Thou shalt also keep thy Irish Pub or Taverna in sound financial health.
Klatuu wrote:
I am suprised that no one mentioned the fact that autonumber fields will not
necessarily remain sequential. If you cancel adding record or delete a
record, then there are gaps. Actually, although it is not one of the Access
"Ten Commandments", it should be:
Thou shalt use Autonumber only for relating thy tables and only for relating
thy tables shall ye use Autonumber. Gazing upon the values of thy
autonumbers or in thy heart considering calculations upon thy autonumber will
lead thee into peril and misery.
:
use something like this:
Module:
Dim AutoNumID As Long
Sub InitAutoNum()
AutoNumID = 0
End Sub
Public Function fnAutoNum(ByVal ID As Long) As Long
AutoNumID = AutoNumID + 1
fnAutoNum = AutoNumID
End Function
first call InitAutoNum
then run an make table like
SELECT Table.ID, fnAutoNum([ID]) AS AutoID INTO tmpTable FROM
;
try something like this.
:
Hi folks,
Does anyone know how to create a function which can be used in query to auto
number the record? Some thing like:
function autonumber(start number as interger) as interger
--
--
--
end function.
Thanks in advance.
Tim.