People pls help me i am getting a compiler error - Loop Without Do
This is my Code
Dim cn As New ADODB.Connection
Dim rs As New ADODB.Recordset
cn = New ADODB.Connection
cn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Users\Shyam\Documents\Database1.mdb;Persist Security Info=False"
cn.Open()
rs = New ADODB.Recordset
rs.Open("select* from STUDENTSWITHHOA", cn, adOpenKeyset, adLockOptimistic)
Do Until rs.EOF
If rs!RegNo = Text2.Text Then
If IsNull(rs("Name")) Then
answer = MsgBox("The Register Number You Entered Didnt Provide All The Inforamtion Do you still Want to Display the Details", vbYesNo + vbExclamation, "Alert")
If answer = vbYes Then
Text1.Text = rs!Name
Text3.Text = rs!MobileNo
Text4.Text = rs!E_mailId
Text5.Text = rs!ArrearYear
Text6.Text = rs!ArrearSemester
Text7.Text = rs!ArrearSubject
Text8.Text = rs!HOA
If answer = vbNo Then
Form1.Show()
Else
rs.MoveNext()
End If
Loop
MsgBox("THE REGISTER NUMBER U ENTERED DOES NOT HAVE HISTORY OF ARREARS")
rs.Close