subform scroll bar scroll to bottom (1 Viewer)

bobbybeers

Registered User.
Local time
Today, 03:53
Joined
Mar 14, 2013
Messages
17
I have a form and in the form is a subform. When I add a record with the following code, the subform detail scrolls in such a way that you can't see the record you just added...only a single blank new record. Can you set the scroll position so that I can see all the previous records including the one I just added?

Private Sub Add_PROJ_RECORD()
On Error GoTo Err_Add_Click

Me.PROJECT_DATA.Locked = False
Me!PROJECT_DATA.SetFocus
DoCmd.GoToRecord , , acNewRec

Me.PROJECT_DATA.Form.PROJ = PROJ_COMBO
Me.PROJECT_DATA.Form.SPEC = SPEC_COMBO

Exit Sub
 

bobbybeers

Registered User.
Local time
Today, 03:53
Joined
Mar 14, 2013
Messages
17
OK, I figured out how to do this.... I know its cheesy but it does exactly what I want which is manipulate the scroll position on the subform detail section....hopefully it will help someone else out at some point.
after I perform all my operations I simply move the position in the subform by
DoCmd.GoToRecord , , acPrevious
DoCmd.GoToRecord , , acPrevious
DoCmd.GoToRecord , , acPrevious
you can move the cursor as many or as few as you need to
 

bobbybeers

Registered User.
Local time
Today, 03:53
Joined
Mar 14, 2013
Messages
17
heres a more elequent way by using a loop for record navigation:
simply call MOVE_CURSOR in your main operation and you can set rows for however many rows you want to move up

Private Sub MOVE_CURSOR()

Dim ROWS As Variant
ROWS = 8

Do Until ROWS = 0
DoCmd.GoToRecord , , acPrevious
ROWS = ROWS - 1
Loop

End Sub
 

Users who are viewing this thread

Top Bottom