I want to open the form on the last selected record

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
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
 
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
 
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
 
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
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top