Results 1 to 3 of 3

Thread: Pulling The Last Record

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jan 2000
    Location
    Greenville
    Posts
    73
    Hey I have been trying to pull a recordset from a table in my DB and then select the last record in that table but It won't happen right and pull the last one. I have been using the following:


    Sql2 = ("Select * from LocationTracking Where locationtracking.AccountNum = " & "'" & txtFindAccount.Text & "'")

    tb13 = db.openrecordset(sql2)

    tb13.movelast

    Then it pulls a account from the table that is in the middle somewhere and I need it to pull the last one. Any suggestions, Please.

  2. #2
    Lively Member
    Join Date
    Jan 2000
    Location
    Springfield, IL
    Posts
    124

    Lightbulb

    Add an Order By Account to your select statement after your WHERE clause.

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Jan 2000
    Location
    Greenville
    Posts
    73
    Thankyou Thankyou Thankyou

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width