S
Sue
I am creating an adodb recordest and setting the recoredset property
of the form to the adodb recordset - but what's happening is that only
the last value of the recordset is displayed in the form, so even if
the recordset has 25 records, only one value (the last one) is
displayed - this happens even when the form is set to be datasheet
view- please see my code below, any suggestions will be really
helpful, thank you very much.
Dim cn As ADODB.Connection
Dim rs As ADODB.Recordset
Set cn = CurrentProject.AccessConnection
Set rs = New ADODB.Recordset
With rs
Set .ActiveConnection = cn
.Source = qrydept
.LockType = adLockReadOnly
.CursorType = adOpenStatic
.CursorLocation = adUseClient
.Open
End With
Set Me.Recordset = rs
Do While Not rs.EOF
Forms![frmDeptSearch]!txtid = rec.Fields![EMPLID].Value
rs.MoveNext
Loop
rs.Close
Set rs = Nothing
Set cn = Nothing
of the form to the adodb recordset - but what's happening is that only
the last value of the recordset is displayed in the form, so even if
the recordset has 25 records, only one value (the last one) is
displayed - this happens even when the form is set to be datasheet
view- please see my code below, any suggestions will be really
helpful, thank you very much.
Dim cn As ADODB.Connection
Dim rs As ADODB.Recordset
Set cn = CurrentProject.AccessConnection
Set rs = New ADODB.Recordset
With rs
Set .ActiveConnection = cn
.Source = qrydept
.LockType = adLockReadOnly
.CursorType = adOpenStatic
.CursorLocation = adUseClient
.Open
End With
Set Me.Recordset = rs
Do While Not rs.EOF
Forms![frmDeptSearch]!txtid = rec.Fields![EMPLID].Value
rs.MoveNext
Loop
rs.Close
Set rs = Nothing
Set cn = Nothing