Move to last record

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

I need to move the record pointer to the last record in my main table. I try
using GotoRecord but I get error messages about table not being open.

What code do i use to move to last record in a table named StudentProfile?

Thanks in advance.

-AKA
 
What are you trying to do?
why do you need to move to the last record?
Is the table open?
====================
when the table open you can use the control on the buttom of the table to
navigate between the records, and to move to the last record
Is the table open?
====================
You can use a query to display the last record
====================
Using a code, you can open recordset and then move to the last record.
====================
You can open a form and display the last record
====================

What do you need to do? so we can help you.
 
Use that
dim MyDb as database
dim MyRec as recordset

Set MyDb=codedb()
Set Myrec = MyDb.openrecordset("Select * From MyTable Order by CustID")
If not Myrec.eof then
MyRec.movelast

' Do here what you need to do with the last record, dont forget to sort it
in a way that the last record is the last record that you need, if by custid
or a date.
End If
 
Ofer,

Thanks for your reply and your help. With some modification it's working
quite well.

-AKA
 
Back
Top