Marcel2586
Registered User.
- Local time
- Today, 03:13
- Joined
- Mar 1, 2012
- Messages
- 41
Hello,
I have a problem with my code.
It works, but it starts with row number 15, field number 2
then it go's to row 16, field number 1. then row 16, field 2
Why wont it start at row one, field one then print that record. row 1 field 2 and print that record.......

I have a problem with my code.
It works, but it starts with row number 15, field number 2
then it go's to row 16, field number 1. then row 16, field 2
Why wont it start at row one, field one then print that record. row 1 field 2 and print that record.......
Code:
Option Compare Database
Public Function test(Split1 As Variant)
On Error GoTo Err_Proc
'declare recordsets
Dim rs As DAO.Recordset
Dim db As Database
Set db = CurrentDb
Set rs = db.OpenRecordset("tbl WVL customer only")
Dim strSQL As String
Dim intFieldIndex As Integer
'look for records
strSQL = "SELECT split1, split2, split3 FROM [tbl WVL customer only]"
intFieldIndex = 1
Set rs = CurrentDb.OpenRecordset(strSQL)
If rs.RecordCount <> 0 Then
rs.MoveFirst
While Not rs.EOF
'temporary print to debug screen
For i = 0 To 2
'Debug.Print rs(i)
Debug.Print rs.Fields(i)
Next i
rs.MoveNext
Wend
End If
'close all and cleanup
rs.Close
Set rs = Nothing