If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
|
#1
|
|||
|
|||
reset autonumber value in table
Thanks! I will try this.
-----Original Message----- ADOX example from Microsoft Function ChangeSeed(strTbl As String, strCol As String, lngSeed As Long) As Boolean 'You must pass the following variables to this function. 'strTbl = Table containing autonumber field 'strCol = Name of the autonumber field 'lngSeed = Long integer value you would like to use for next autonumber. Dim cnn As ADODB.Connection Dim cat As New ADOX.Catalog Dim col As ADOX.Column 'Set connection and catalog to current database Set cnn = CurrentProject.Connection cat.ActiveConnection = cnn Set col = cat.Tables(strTbl).Columns(strCol) col.Properties("Seed") = lngSeed cat.Tables(strTbl).Columns.Refresh If col.Properties("seed") = lngSeed Then ChangeSeed = True Else ChangeSeed = False End If Set col = Nothing Set cat = Nothing Set cnn = Nothing End Function (david) "Elizabeth" wrote in message ... Anyone have a routine to reset an autonumber field to 1? . |
Thread Tools | |
Display Modes | |
|
|