J
Jim Kennedy
Hi,
Here's how I tackled this. I created an unbound form and
added 3 text boxes (text1,2, & 3) to hold the data I want
and then a 4th text box (repeat) to enter the number of
records I want to add. Then I added a command button and
entered this code:
Private Sub cmdAdd_Click()
Dim i As Integer
Dim intCount
Dim rs As ADODB.Recordset
Set rs = New ADODB.Recordset
rs.Open "games", CurrentProject.Connection, _
adOpenStatic, adLockOptimistic, adCmdTable
intCount = Me.Repeat
For i = 1 To intCount
rs.AddNew
rs![game_no] = Me.Text1
rs![winner] = Me.Text2
rs![loser] = Me.Text3
rs.Update
Next i
MsgBox "done"
rs.close
set rs = nothing
End Sub
You'll have to customize it for your table and field
names, but maybe this will get you started in the right
direction.
Jim
Here's how I tackled this. I created an unbound form and
added 3 text boxes (text1,2, & 3) to hold the data I want
and then a 4th text box (repeat) to enter the number of
records I want to add. Then I added a command button and
entered this code:
Private Sub cmdAdd_Click()
Dim i As Integer
Dim intCount
Dim rs As ADODB.Recordset
Set rs = New ADODB.Recordset
rs.Open "games", CurrentProject.Connection, _
adOpenStatic, adLockOptimistic, adCmdTable
intCount = Me.Repeat
For i = 1 To intCount
rs.AddNew
rs![game_no] = Me.Text1
rs![winner] = Me.Text2
rs![loser] = Me.Text3
rs.Update
Next i
MsgBox "done"
rs.close
set rs = nothing
End Sub
You'll have to customize it for your table and field
names, but maybe this will get you started in the right
direction.
Jim