Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Scrolling subforms

29 views
Skip to first unread message

Phil

unread,
May 30, 2012, 7:48:51 AM5/30/12
to
I have a subfom sized to show up to 16 records i.e. about 4" high and each
record is about 1/4" high The subform itself can contain anything from no
records to many hundreds. I want to go to a new record, bur see as many of
the preeceeding records as possible, so the new record needs to be near the
bottom of the subform. Using Access 2010, what is the easiest way please?
Phil

Ron Paii

unread,
May 30, 2012, 8:01:01 AM5/30/12
to


"Phil" <ph...@stantonfamily.co.uk> wrote in message
news:jq51f1$97e$1...@speranza.aioe.org...
Access has no record number. You will need to sort the subform on a field or
fields that will put the records in the order you need.

Patrick Finucane

unread,
May 30, 2012, 9:44:03 AM5/30/12
to
If A2010, a split form might work nice.

Phil

unread,
May 30, 2012, 12:55:55 PM5/30/12
to
Thanks Ron
The records are already sorted in date order. I suppose I want to see the
last 15 records (assuming that there are at least 15 records), then move to a
new record. If there are less than 15 records say 7 records, the new record
will appear in the middle of the subform so no problem.

Phil

Phil

unread,
May 30, 2012, 1:05:22 PM5/30/12
to
Thanks but not what I want

Phil

Phil

unread,
May 30, 2012, 7:36:03 PM5/30/12
to
Solved it

The subform is on a Tab control.
The OnCurrent of the main form or on changing tabs I call this StayOnTab
routine (abbreviated)

Sub StayOnTab()

Dim i As Integer
On Error GoTo StayOntab_Err

If TabCtl118 = 1 Then ' Dividends
DoCmd.GoToControl "subDividends"
DoCmd.GoToRecord , , acLast
For i = 1 To 15
DoCmd.GoToRecord , , acPrevious
Next i
DoCmd.GoToRecord , , acNewRec
End If

Exit Sub

StayOntab_Err:
If Err = 2105 Then ' You can't go to the specified record
Resume Next
Else
MsgBox "Error" & Err & " " & Err.Description
End If

End Sub

Thanks anyway

Phil
0 new messages