GoToRecord problem

andrewf10

Registered User.
Local time
Today, 22:10
Joined
Mar 2, 2003
Messages
114
Hi all,

Can someone pleeeeease give me some help here?


I have a table tblLogUsers with 3 fields - UserName, LogonDate and LogoffDate.

I need to do some sort of Docmd.GoToRecord on this tables form (frmLogUsers) so that the current user, which is got from a module, is looked up on it and his/her last record is found.


For example, John Doe's name might appear 10 times but I need to jump to the last of his entries, which are sorted by Username and then LogonDate.


Is this possible? Any ideas greatly appreciated
 
You're going to need to use recordsets

Dim db as DAO.Database
Dim rst As DAO.Recordset

Set db=CurrentDb

Set rst=db.OpenRecordset("[Table Name]")

rst.FindLast "UserName='" & CurrentUser & "'"
 
Thanks Rob.

Am I right in thinking you're using Access 97 because Access 2000 doesnt seem to be recognising the first 2 lines?
 
Oh, sorry I forgot to let you know. In 2000 you need to set a reference to the Microsoft DAO 3.6 library. That'll fix that.
 

Users who are viewing this thread

Back
Top Bottom