How to search for Access 2003 record using VB6

10 pts.
Tags:
Microsoft Access 2003
VB6
How can I search for the last updated record in my Access 2003 database from VB 6, the code I'm using only returns the first record on the database.
On Error GoTo err:
Dim sql As String
Set con = New ADODB.Connection

      con.CursorLocation = adUseClient
      con.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:Program Filesjosoftdatabasejosoft.mdb;Persist Security Info=False"

      Set rs = New ADODB.Recordset

    rs.Open "Select * from [FeeBalance] where [AdmnNo] = '" & Text1.Text & "'", con, 3, 3
    rs.MoveLast
    'rs.MoveNext

    If rs.EOF And rs.BOF Then

            MsgBox ("No Fee Balance Found  in the Above Student!")
        Else

    rs.MoveLast
    Text15.Text = rs!Amountpaid
    Text17.Text = rs!balance

   End If
err:

Answer Wiki

Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Discuss This Question:  

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following