R
rivers
Hi All
I have created a program that transfers information from one record into 53
records in a subform.
the 1 record has 53 weeks in it, and for each week i need to create one
record in my subform.
the program works except. it needs to run through 1000 records and creates
over 53000 records (sounds alot but nessassary)
however when my screensave comes on or i Move to another screen it crashes
my program and reverts me back to square one!! can anyone help
Private Sub Command123_Click()
Dim i As Integer
Dim sel As String
Dim sel2 As Double
Dim sel3 As String
Dim i2 As Integer
Dim counttot As Integer
Dim check1 As Double
counttot = Form.Recordset.RecordCount
i2 = 1
i = 1
Do Until i2 = counttot
i = 1
sel3 = Forms![1 Run]![KPI CSV name].Value
'Application.Echo False
Do Until i = 54
Forms![1 Run]![Weekchk] = i
sel = "WK " & i
sel2 = Forms![1 Run].Controls(sel)
Forms![1 Run]![UPLOAD KPI subform].Controls(sel3).Value = sel2
check1 = Forms![1 Run]![UPLOAD KPI subform].Controls(sel3).Value
'Forms![1 Run]![UPLOAD KPI subform].SetFocus
'Forms![1 Run]!ID.SetFocus
i = i + 1
Loop
'Application.Echo True
'Forms![1 Run]!ID.SetFocus
DoCmd.GoToRecord , , acNext
i2 = i2 + 1
Loop
DoCmd.GoToRecord , , acFirst
End Sub
I have created a program that transfers information from one record into 53
records in a subform.
the 1 record has 53 weeks in it, and for each week i need to create one
record in my subform.
the program works except. it needs to run through 1000 records and creates
over 53000 records (sounds alot but nessassary)
however when my screensave comes on or i Move to another screen it crashes
my program and reverts me back to square one!! can anyone help
Private Sub Command123_Click()
Dim i As Integer
Dim sel As String
Dim sel2 As Double
Dim sel3 As String
Dim i2 As Integer
Dim counttot As Integer
Dim check1 As Double
counttot = Form.Recordset.RecordCount
i2 = 1
i = 1
Do Until i2 = counttot
i = 1
sel3 = Forms![1 Run]![KPI CSV name].Value
'Application.Echo False
Do Until i = 54
Forms![1 Run]![Weekchk] = i
sel = "WK " & i
sel2 = Forms![1 Run].Controls(sel)
Forms![1 Run]![UPLOAD KPI subform].Controls(sel3).Value = sel2
check1 = Forms![1 Run]![UPLOAD KPI subform].Controls(sel3).Value
'Forms![1 Run]![UPLOAD KPI subform].SetFocus
'Forms![1 Run]!ID.SetFocus
i = i + 1
Loop
'Application.Echo True
'Forms![1 Run]!ID.SetFocus
DoCmd.GoToRecord , , acNext
i2 = i2 + 1
Loop
DoCmd.GoToRecord , , acFirst
End Sub