Angelo, Basically it involves use of DoCmd.GoToRecord method
after setting focus on the subform control.
Sample code is given below. SF_1 & SF_2 are the
names of subform controls. On Error Resume Next statement is meant to prevent
error message while trying to move prior to first record (by acPrevious
argument) or beyond the new record (by acNext argument).
Best wishes,
A.D.Tejpal
==================================
Private Sub CmdFirst_Click()
On Error Resume Next SF_1.SetFocus DoCmd.GoToRecord , , acFirst SF_2.SetFocus DoCmd.GoToRecord , , acFirst End Sub -----------------------------------------------------------
Private Sub CmdLast_Click()
On Error Resume Next SF_1.SetFocus DoCmd.GoToRecord , , acLast SF_2.SetFocus DoCmd.GoToRecord , , acLast End Sub -----------------------------------------------------------
Private Sub CmdNext_Click()
On Error Resume Next SF_1.SetFocus DoCmd.GoToRecord , , acNext SF_2.SetFocus DoCmd.GoToRecord , , acNext End Sub -----------------------------------------------------------
Private Sub CmdPrev_Click()
On Error Resume Next SF_1.SetFocus DoCmd.GoToRecord , , acPrevious SF_2.SetFocus DoCmd.GoToRecord , , acPrevious End Sub ==================================
Please zip all files prior to uploading to Files section. YAHOO! GROUPS LINKS
|
- [AccessDevelopers] replacing vertical scroll bars with but... Angelo Antonino
- Re: [AccessDevelopers] replacing vertical scroll bars... A.D.Tejpal
- RE: [AccessDevelopers] replacing vertical scroll ... Angelo Antonino