going to the last existing record

octatyan

Registered User.
Local time
Today, 12:47
Joined
Jan 10, 2003
Messages
36
Here's an easy question I can't figure out...

I have a CANCEL button for when people are creating a new record and decide to cancel it. How do I make Access go to the last existing record when the user clicks the CANCEL button? Currently, when pressing CANCEL, Access still remains on the new, blank record.

thanks
 
ok, i added to code which will go to the previous record after hitting the CANCEL button:

DoCmd.GoToRecord , , acPrevious

I just copy and pasted that code from the Access created VB for a "Previous Record" button.

The concern I have is, what happens if there is some sort of error with the "previous record" Access will go to? Should I be concerned or am I worrying too much? Should I insert code that says something like "goto.recordset.upperbound" which would go directly to the last existing record.

I know "goto.recordset.upperbound" isn't the correct code, but it's just an example to show what I'm trying to say because I don't know what the correct code is.

any help is greatly appreciated, thanks!
 
DoCmd.GoToRecord , , acLast
 

Users who are viewing this thread

Back
Top Bottom