A
A Newbie
I Æ°ant to show all in Continuous Form by this code but I only get last record
only
so anybody can help me to show all record.
Thanks very much !!!
Dim db As Dao.Database
Dim rec As Dao.Recordset
Dim strSQL As String
Set db = CurrentDb()
strSQL = "SELECT tblA.A, tblA.B "
strSQL = strSQL & "FROM tblA "
strSQL = strSQL & "WHERE tblA.DEL= " & "Yes"
Set rec = db.OpenRecordset(strSQL)
i = rec.RecordCount
If i > 0 Then
rec.MoveFirst
With rec
Do Until rec.EOF
[Forms]![frmA]![txtA] = .Fields("A")
[Forms]![frmA]![txtB] = .Fields("B")
rec.MoveNext
Loop
End With
End If
rec.MoveLast
only
so anybody can help me to show all record.
Thanks very much !!!
Dim db As Dao.Database
Dim rec As Dao.Recordset
Dim strSQL As String
Set db = CurrentDb()
strSQL = "SELECT tblA.A, tblA.B "
strSQL = strSQL & "FROM tblA "
strSQL = strSQL & "WHERE tblA.DEL= " & "Yes"
Set rec = db.OpenRecordset(strSQL)
i = rec.RecordCount
If i > 0 Then
rec.MoveFirst
With rec
Do Until rec.EOF
[Forms]![frmA]![txtA] = .Fields("A")
[Forms]![frmA]![txtB] = .Fields("B")
rec.MoveNext
Loop
End With
End If
rec.MoveLast