I’m trying to use a loop on my parent form to add records to the sub form. For each week in the loop I would like to have a new record in the sub. Here is my code so far. Suggestions?
Code:
Option Compare Database
Option Explicit
Private Sub cmdEnter_Click()
Dim b As Integer
Dim x As Integer
Dim Y As Integer
Dim w As Integer
Dim th As Integer
b = Format(Me.Date1(), "ww") - Format(Me.Date2(), "ww")
Me.WeeksToBuild = wtb
x = Format(Me.Date1(), "ww")
w = Format(Me.Date2(), "ww")
th = Me.TotalHr / b
Y = b + w
For x = w To Y
If x < Y Then
Forms.frmMain.frmsubMain.Form.WkNumber = x
[COLOR=red]I think I need a call for a new record here but i'm unable to think of how to do it[/color]
End If
Next x
End Sub