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
|
|||
|
|||
How to fill fill a column with numbers, beginning at number X,counting up.
I simply need to add numbers, beginning with 15,347, (counting
upward), to a column with empty values in a table. Is there an easy way to do this, rather than completing it in excel and importing it, then attempting to update the table? Thanks for any suggestions. |
#2
|
|||
|
|||
How to fill fill a column with numbers, beginning at number X, counting up.
While I cannot imagine a legitimate use for this, the following code will
insert rows starting at 15347 and going to 22000 Dim dbCurr As DAO.Database Dim lngLoop As Long Dim strSQL As String Set dbCurr = CurrentDb For lngLoop = 15347 To 22000 strSQL = "INSERT INTO MyTable (MyField) " & _ "VALUES (" & lngLoop & ")" dbCurr.Execute strSQL, dbFailOnError Next lngLoop Set dbCurr = Nothing Prepopulating tables is seldom (if ever) appropriate. -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no private e-mails, please) "Mike C" wrote in message ... I simply need to add numbers, beginning with 15,347, (counting upward), to a column with empty values in a table. Is there an easy way to do this, rather than completing it in excel and importing it, then attempting to update the table? Thanks for any suggestions. |
Thread Tools | |
Display Modes | |
|
|