A family of Microsoft relational database management systems designed for ease of use.
I was able to figure out what I needed but now am having problems with one section of code. The problem is when the code changes to another sheet to continue adding the data. I have noticed that it is putting each record 9 times. Not sure why this is happening. Any suggestions would be appreciated.
Thanks
Bob
Dim xlRow As Integer
Dim lRow As Integer
Dim rs As DAO.Recordset
Dim c As Integer
Set rs = Me.Child207.Form.RecordsetClone
xlRow = (wsheet.Columns("K").End(xlDown).Row)
c = 11
xlRow = xlRow + 16
Do Until rs.EOF
' For Each fld In rs.Fields
For Each MfrPartNumber In rs.Fields
If wsheet.Name = "MFR-02-2" Then
wsheet.Cells(xlRow, c).Value = rs!MfrPartNumber
wsheet.Cells(xlRow, 14).Value = rs!PartRev
wsheet.Cells(xlRow, 15).Value = rs!Quantity
lRow = 4
ElseIf wsheet.Name = "MFR-02-2A-EPL" Then
wsheet.Cells(lRow, 1).Value = rs!MfrPartNumber
wsheet.Cells(lRow, 5).Value = rs!PartRev
wsheet.Cells(lRow, 6).Value = rs!Quantity
lRow = lRow + 1
End If
Next MfrPartNumber
xlRow = xlRow + 1
rs.MoveNext
If xlRow > 24 Then
Set wsheet = wbook.Worksheets("MFR-02-2A-EPL")
End If
Loop
Set rs = Nothing