I need to generate new records in bulk. I searched this forum and net and at last the below code worked partially to my requirement.
I call this function from a button on the form in which I need to fill various field first and then fill desired row count then I need to generate new records with all data filled same as filled currently on form.
But, it does populate only one field (which is autonumber), because I could not set other fields syntax etc.
Could somebody help me in this.
best regards.
Public Sub AddRows()
Dim strSQL As String
Dim i As Integer
strSQL = "INSERT INTO Tblinkcode (bottleID) SELECT MAX (bottleID) + 1 FROM Tblinkcode "
For i = 1 To Me.rowcount
CurrentDb.Execute strSQL
Next i
End Sub
I call this function from a button on the form in which I need to fill various field first and then fill desired row count then I need to generate new records with all data filled same as filled currently on form.
But, it does populate only one field (which is autonumber), because I could not set other fields syntax etc.
Could somebody help me in this.
best regards.