
#Add sequential numbers in excel 2013 code
' Error code for "There is no current record." Optional ByVal FirstNumber As Long = 1) _ ' Number = RecordNumber(Forms("NameOfSomeOpenForm")) ' Number = RecordNumber(Forms(IndexOfFormInFormsCollection)) ' If the form can add records, insert this code line in the ' Private Sub Form_AfterDelConfirm(Status As Integer) ' If the form can delete records, insert this code line in the ' NB: For localised versions of Access, when entering the expression, type ' Optionally, specify another first number than 1, say, 0: ' The returned number will equal the Current Record displayed in the ' Create a TextBox to display the record number. ' For a new record, Null is returned until the record is saved.

' in a form, even if no primary or unique key is present. Study the in-line comments: ' Creates and returns a sequential record number for records displayed You can have an external function which you pass the form as an argument. The initial record sequence is important and needs to be maintained. (Maybe?)Is there a way to maybe loop through each row(row by row) copying to a new table then creating a SEQ number there and repeating 30 times? I don't care even if I need to do this field by field row by row.įor example, I'm ok if I need to simply go: 1 - Bikesīut how do I go row by row like that and maintain sequence order I had from the start? Is there a looping process? How do I simply add sequence numbers from 1-30 next to my data? Or at the very least how do I add a sequence number for the data I have? This always results in my SEQ numbers showing up below the data even though it's a newly created field. StrSqlSEQNum = "INSERT INTO Friends (SEQ) Values(" & SEQNum & ") " I have tried looping insert queries as shown below: strSQLaddSEQ = "ALTER TABLE tblFriends ADD SEQ Number "


I would like to generate sequential numbers next to each of the Names, but this seems to be extremely difficult. The data and number of records within tblFriends changes everyday but is never more than 30. TblFriends is generated from query qryFriends.
