View Full Version : Set Focus to last record


=TB=
11-12-2003, 07:15 AM
I have a customers form that opens (datasheet view) allowing a user to choose a customer - on this form there is a button to add a new customer via a another pop up form. When this (add new) pop up form closes, it requerys the customer form, showing the new customer in the list, which is fine but I want to set focus in the customer form to record that has just been added (last new record).

Tried allsorts of ways of doing this but none seem to work, can anyone point me in the correct direction.

Thanks in advance.

dcx693
11-12-2003, 07:30 AM
Does this work?:
DoCmd.RunCommand acCmdRecordsGoToLast

Travis
11-12-2003, 07:39 AM
What you will need is:

1. A Unique Item to search (Such as the Unique ID of your Customer, which should be in the RecordSet of your DataSheet but does not need to be visible)

2. You will then need a RecordSetClone of the DataSheet

3. Then the Use of the FindFirst and BookMark.

4. This Knowledgebase article ACC2000: Using Code to Dynamically Synchronize Two Forms (http://support.microsoft.com/default.aspx?scid=kb;en-us;210060&Product=acc)

=TB=
11-13-2003, 10:12 AM
Thanks for all the help, I was hoping there would be a simplier method as all I want to do is set focus to the last record an event that only happens once. Will keep playing.