![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I know this should be simple but... Having updated a record on a continuous form using VBA, I want the form to scroll so that the updated record is at the top or the form. Any ideas please Thanks Phil Nearest thing I can think of is to sort on a field (timestamp) and |
#3
| |||
| |||
|
|
Phil wrote: I know this should be simple but... Having updated a record on a continuous form using VBA, I want the form to scroll so that the updated record is at the top or the form. Any ideas please Thanks Phil Nearest thing I can think of is to sort on a field (timestamp) and requery after update. |
#4
| |||
| |||
|
|
"Salad" <salad (AT) oilandvinegar (DOT) com> wrote in message news:ZaOdnTq3K-dTBRzQnZ2dnUVZ_gqdnZ2d (AT) earthlink (DOT) com... Phil wrote: I know this should be simple but... Having updated a record on a continuous form using VBA, I want the form to scroll so that the updated record is at the top or the form. Any ideas please Thanks Phil Nearest thing I can think of is to sort on a field (timestamp) and requery after update. I have used this to get the result that you are after: Dim MyID As Long 'Assumes an ID field of LONG data type Dim MyRs As Object MyID = Me.FieldContainingID 'Your update code here............. Set MyRs = Me.Recordset.Clone MyRs.FindFirst "[FieldContainingID] = " & MyID Me.Bookmark = MyRs.Bookmark MyRs.Close I also added a line using SetFocus to highlight the modified field. HTH Malcolm |
#5
| |||
| |||
|
|
On 17/03/2011 06:24:37, "Malcolm" wrote: "Salad" <sa... (AT) oilandvinegar (DOT) com> wrote in message news:ZaOdnTq3K-dTBRzQnZ2dnUVZ_gqdnZ2d (AT) earthlink (DOT) com... Phil wrote: I know this should be simple but... Having updated a record on a continuous form using VBA, I want the form to scroll so that the updated record is at the top or the form. Any ideas please Thanks Phil Nearest thing I can think of is to sort on a field (timestamp) and requery after update. I have used this to get the result that you are after: Dim MyID As Long 'Assumes an ID field of LONG data type Dim MyRs As Object MyID = Me.FieldContainingID 'Your update code here............. Set MyRs = Me.Recordset.Clone MyRs.FindFirst "[FieldContainingID] = " & MyID Me.Bookmark = MyRs.Bookmark MyRs.Close I also added a line using SetFocus to highlight the modified field. HTH Malcolm Thanks for replying. 'Fraid it doesn't work. There is no problem getting back to the original record, the problem is that I want that record to be the first one visible at the top of the continuous form. I know there are complex routines with scroll bars (My hero - Stephen Lebans) but I wonderd if there was something more simple in Access 2010 Phil- Hide quoted text - - Show quoted text - |
#6
| |||
| |||
|
|
On Mar 17, 10:43*am, "Phil" <p... (AT) stantonfamily (DOT) co.uk> wrote: On 17/03/2011 06:24:37, "Malcolm" wrote: "Salad" <sa... (AT) oilandvinegar (DOT) com> wrote in message news:ZaOdnTq3K-dTBRzQnZ2dnUVZ_gqdnZ2d (AT) earthlink (DOT) com... Phil wrote: I know this should be simple but... Having updated a record on a continuous form using VBA, I want the fo rm to scroll so that the updated record is at the top or the form. Any idea s please Thanks Phil Nearest thing I can think of is to sort on a field (timestamp) and req uery after update. I have used this to get the result that you are after: Dim MyID As Long 'Assumes an ID field of LONG data type Dim MyRs As Object MyID = Me.FieldContainingID 'Your update code here............. Set MyRs = Me.Recordset.Clone MyRs.FindFirst "[FieldContainingID] = " & MyID Me.Bookmark = MyRs.Bookmark MyRs.Close I also added a line using SetFocus to highlight the modified field. HTH Malcolm Thanks for replying. 'Fraid it doesn't work. There is no problem getting back to the original record, the problem is that I want that record to be the first one visibl e at the top of the continuous form. I know there are complex routines with sc roll bars (My hero - Stephen Lebans) but I wonderd if there was something more simple in Access 2010 Phil- Hide quoted text - - Show quoted text - Hi Phil, If you got back to the original record, you could try MyForm.SelTop = MyForm.CurrentRecord to place it on the first line of your MyForm. Imb. |
#7
| |||
| |||
|
|
On 17/03/2011 06:24:37, "Malcolm" wrote: "Salad" <salad (AT) oilandvinegar (DOT) com> wrote in message news:ZaOdnTq3K-dTBRzQnZ2dnUVZ_gqdnZ2d (AT) earthlink (DOT) com... Phil wrote: I know this should be simple but... Having updated a record on a continuous form using VBA, I want the form to scroll so that the updated record is at the top or the form. Any ideas please Thanks Phil Nearest thing I can think of is to sort on a field (timestamp) and requery after update. I have used this to get the result that you are after: Dim MyID As Long 'Assumes an ID field of LONG data type Dim MyRs As Object MyID = Me.FieldContainingID 'Your update code here............. Set MyRs = Me.Recordset.Clone MyRs.FindFirst "[FieldContainingID] = " & MyID Me.Bookmark = MyRs.Bookmark MyRs.Close I also added a line using SetFocus to highlight the modified field. HTH Malcolm Thanks for replying. 'Fraid it doesn't work. There is no problem getting back to the original record, the problem is that I want that record to be the first one visible at the top of the continuous form. I know there are complex routines with scroll bars (My hero - Stephen Lebans) but I wonderd if there was something more simple in Access 2010 Phil |
#8
| |||
| |||
|
|
On 17/03/2011 10:24:31, imb wrote: On Mar 17, 10:43 am, "Phil" <p... (AT) stantonfamily (DOT) co.uk> wrote: On 17/03/2011 06:24:37, "Malcolm" wrote: "Salad" <sa... (AT) oilandvinegar (DOT) com> wrote in message news:ZaOdnTq3K-dTBRzQnZ2dnUVZ_gqdnZ2d (AT) earthlink (DOT) com... Phil wrote: I know this should be simple but... Having updated a record on a continuous form using VBA, I want the fo rm to scroll so that the updated record is at the top or the form. Any idea s please Thanks Phil Nearest thing I can think of is to sort on a field (timestamp) and req uery after update. I have used this to get the result that you are after: Dim MyID As Long 'Assumes an ID field of LONG data type Dim MyRs As Object MyID = Me.FieldContainingID 'Your update code here............. Set MyRs = Me.Recordset.Clone MyRs.FindFirst "[FieldContainingID] = " & MyID Me.Bookmark = MyRs.Bookmark MyRs.Close I also added a line using SetFocus to highlight the modified field. HTH Malcolm Thanks for replying. 'Fraid it doesn't work. There is no problem getting back to the original record, the problem is that I want that record to be the first one visibl e at the top of the continuous form. I know there are complex routines with sc roll bars (My hero - Stephen Lebans) but I wonderd if there was something more simple in Access 2010 Phil- Hide quoted text - - Show quoted text - Hi Phil, If you got back to the original record, you could try MyForm.SelTop = MyForm.CurrentRecord to place it on the first line of your MyForm. Imb. Thanks Imb Sounds as if it should work, but Me.SelTop appears to be the same as Me.CurrentRecord, so no movement. Me.SelTop = 1 doesn't work either Phil |
#9
| |||
| |||
|
#10
| |||
| |||
|
|
On 17/03/2011 10:24:31, imb wrote: On Mar 17, 10:43 am, "Phil" <p... (AT) stantonfamily (DOT) co.uk> wrote: On 17/03/2011 06:24:37, "Malcolm" wrote: "Salad" <sa... (AT) oilandvinegar (DOT) com> wrote in message news:ZaOdnTq3K-dTBRzQnZ2dnUVZ_gqdnZ2d (AT) earthlink (DOT) com... Phil wrote: I know this should be simple but... Having updated a record on a continuous form using VBA, I want thefo rm to scroll so that the updated record is at the top or the form. Any idea s please Thanks Phil Nearest thing I can think of is to sort on a field (timestamp) and req uery after update. I have used this to get the result that you are after: Dim MyID As Long 'Assumes an ID field of LONG data type Dim MyRs As Object MyID = Me.FieldContainingID 'Your update code here............. Set MyRs = Me.Recordset.Clone MyRs.FindFirst "[FieldContainingID] = " & MyID Me.Bookmark = MyRs.Bookmark MyRs.Close I also added a line using SetFocus to highlight the modified field. HTH Malcolm Thanks for replying. 'Fraid it doesn't work. There is no problem getting back to the original record, the problem is that I want that record to be the first one visibl e at the top of the continuous form. I know there are complex routines withsc roll bars (My hero - Stephen Lebans) but I wonderd if there was something more simple in Access 2010 Phil- Hide quoted text - - Show quoted text - Hi Phil, If you got back to the original record, you could try MyForm.SelTop = MyForm.CurrentRecord to place it on the first line of your MyForm. Imb. Thanks Imb Sounds as if it should work, but Me.SelTop appears to be the same as Me.CurrentRecord, so no movement. Me.SelTop = 1 doesn't work either Phil- Hide quoted text - - Show quoted text - |
![]() |
| Thread Tools | |
| Display Modes | |
| |