When the program comes accross the recordset with more then one record it does not report the correct number of records. I took the SQL statement and put it in a query and it works. I read on the forum that I should put rs.movelast before recordcount but this causes an error so did not want to do it.
Do I need to put a rs.movelast before rs.recordcount?
Does RecordCount start at 1 or 0 like an array?
SQLLit = "SELECT tblLinkLibrary.Part_Number, tblLiterature.Literature FROM tblLinkLibrary INNER JOIN tblLiterature ON tblLinkLibrary.LinkLibraryID = tblLiterature.LinkLibraryID WHERE (((tblLinkLibrary.Part_Number)='" & rsParts!Part_Number & "'));"
Set rslit = db.OpenRecordset(SQLLit)
*Pauses program where I know there are two records*******
If rsParts!Part_Number = "3024164" Then
Temp = 1
End If
***********************************************
For X = 1 To rslit.RecordCount
rslit.MoveFirst
With rsVD
.AddNew
!Literature = rslit!Literature
!PartID = rsParts!PartID
.Update
End With
rslit.MoveNext
Next X
End If
Do I need to put a rs.movelast before rs.recordcount?
Does RecordCount start at 1 or 0 like an array?
SQLLit = "SELECT tblLinkLibrary.Part_Number, tblLiterature.Literature FROM tblLinkLibrary INNER JOIN tblLiterature ON tblLinkLibrary.LinkLibraryID = tblLiterature.LinkLibraryID WHERE (((tblLinkLibrary.Part_Number)='" & rsParts!Part_Number & "'));"
Set rslit = db.OpenRecordset(SQLLit)
*Pauses program where I know there are two records*******
If rsParts!Part_Number = "3024164" Then
Temp = 1
End If
***********************************************
For X = 1 To rslit.RecordCount
rslit.MoveFirst
With rsVD
.AddNew
!Literature = rslit!Literature
!PartID = rsParts!PartID
.Update
End With
rslit.MoveNext
Next X
End If