I want to open the form on the last selected record

B

Barry

Hi, thanks for taking the time to read this

This is probably an easy fix but i am new to this. I have a form that shows
the company accounts by job number but when i open the form it automatically
goes to the first record in the table. Is there any way that i could make the
form go to the last edited record on the form when it is opened

Thanks in advance
Barry
 
D

Dennis

In the On Open property of the form, set it to [Event Procedure]
then click on the 3 little buttons at the side and type this code in
DoCmd.GoToRecord , , acLast
 
B

Barry

This only brings me to the last record in the form. I need to go to the last
record i edited which could be in the middle of the record source

Dennis said:
In the On Open property of the form, set it to [Event Procedure]
then click on the 3 little buttons at the side and type this code in
DoCmd.GoToRecord , , acLast

Barry said:
Hi, thanks for taking the time to read this

This is probably an easy fix but i am new to this. I have a form that shows
the company accounts by job number but when i open the form it automatically
goes to the first record in the table. Is there any way that i could make the
form go to the last edited record on the form when it is opened

Thanks in advance
Barry
 
D

Dennis

You can only do this if you hold the date / time in each record of the
underlying table. Access does not hold an internal variable of the last
record edited.

Barry said:
This only brings me to the last record in the form. I need to go to the last
record i edited which could be in the middle of the record source

Dennis said:
In the On Open property of the form, set it to [Event Procedure]
then click on the 3 little buttons at the side and type this code in
DoCmd.GoToRecord , , acLast

Barry said:
Hi, thanks for taking the time to read this

This is probably an easy fix but i am new to this. I have a form that shows
the company accounts by job number but when i open the form it automatically
goes to the first record in the table. Is there any way that i could make the
form go to the last edited record on the form when it is opened

Thanks in advance
Barry
 
K

KARL DEWEY

You will need to add a field EDITED - Date/Time. Create an event to update
the field on change.
Then use a query sorted descending on the EDITED when opening next time.

Dennis said:
You can only do this if you hold the date / time in each record of the
underlying table. Access does not hold an internal variable of the last
record edited.

Barry said:
This only brings me to the last record in the form. I need to go to the last
record i edited which could be in the middle of the record source

Dennis said:
In the On Open property of the form, set it to [Event Procedure]
then click on the 3 little buttons at the side and type this code in
DoCmd.GoToRecord , , acLast

:

Hi, thanks for taking the time to read this

This is probably an easy fix but i am new to this. I have a form that shows
the company accounts by job number but when i open the form it automatically
goes to the first record in the table. Is there any way that i could make the
form go to the last edited record on the form when it is opened

Thanks in advance
Barry
 
B

Barry

Thanks for the help, that will work fine

KARL DEWEY said:
You will need to add a field EDITED - Date/Time. Create an event to update
the field on change.
Then use a query sorted descending on the EDITED when opening next time.

Dennis said:
You can only do this if you hold the date / time in each record of the
underlying table. Access does not hold an internal variable of the last
record edited.

Barry said:
This only brings me to the last record in the form. I need to go to the last
record i edited which could be in the middle of the record source

:

In the On Open property of the form, set it to [Event Procedure]
then click on the 3 little buttons at the side and type this code in
DoCmd.GoToRecord , , acLast

:

Hi, thanks for taking the time to read this

This is probably an easy fix but i am new to this. I have a form that shows
the company accounts by job number but when i open the form it automatically
goes to the first record in the table. Is there any way that i could make the
form go to the last edited record on the form when it is opened

Thanks in advance
Barry
 
Top