Remote record next

Transentient

Registered User.
Local time
Today, 22:05
Joined
Sep 25, 2007
Messages
31
I am looking for a way to activate the record next, record previous, record first and record last on a form. However the activation is based on a control on one form, the record next etc is on another form.

Any ideas

Thanx
 
You could do this. For the On Click event - this should do it:

Forms!Form1.SetFocus
DoCmd.GoToRecord , , acNext
Forms!Form2.SetFocus

That will set focus to the first form which you want, go to the next record, then set the focus back - it will be quick so you probably won't see it unless switching between forms takes time.

You can just replace acNext with acPrevious, acFirst, acLast for the different functions.
 
Many thanks, works great!
 
I forgot to mention, at the top of your sub, you can add this code:

On Error Resume Next

This will resume the next code if say you are at the last record and click the next record button - it won't throw up an error message.

Alternatively, you can have it throw up an error message, and then resume, so that your Form2 will stay with the focus set - otherwise Form1 will have the focus.
 

Users who are viewing this thread

Back
Top Bottom