Move to last record

A

AKA Spawn

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
 
O

Ofer

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.
 
A

AKA Spawn

Ofer,

Using a code, I need to open recordset and then move to the last record.

-AKA
 
O

Ofer

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
 
A

AKA Spawn

Ofer,

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

-AKA
 
Top