[color green]'Init Vars[/color]
Dim oRS As Recordset
Dim f As Integer, i As Long, k As Long, j As Integer
Dim sTotalRecordsToAdd As String
Dim sFieldName As String
[color green]'Prompt and Get Total to Create[/color]
sTotalRecordsToAdd = InputBox("Enter total records to add (1-nnnnnn).", "Total Records", "1000")
If sTotalRecordsToAdd = "" Then
Exit Sub
End If
[color green]'Add New Records[/color]
Screen.MousePointer = vbHourglass
DoEvents
DoEvents
DoEvents
Set oRS = oDB.OpenRecordset("SELECT * FROM main")
For i = 1 To CLng(sTotalRecordsToAdd) - 1
oRS.AddNew
For f = 0 To oRS.Fields.Count - 1
sFieldName = oRS(f).Name
Select Case oRS(f).Type
Case dbText
oRS(sFieldName) = Trim(Str(i)) & ""
Case dbMemo
oRS(sFieldName) = Trim(Str(i)) & ""
Case dbDate
oRS(sFieldName) = Now
End Select
Next
oRS.Update
[color green]'Help CPU Keep Up (timer loop)[/color]
For j = 1 To 5
DoEvents
Next
Next
oRS.Close
[color green]'Help CPU Keep Up (timer loop)[/color]
For j = 1 To 100
DoEvents
Next
Screen.MousePointer = vbDefault
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.