Continious Form Display
am 26.11.2007 16:07:31 von Clint Stowers
Access 2003
I have a Continuous Form. On Open I force it to go to the Last
Record.
When the form opens only the last record is shown at the top. To view
any of the previous records you must scroll. This give the appearance
at first glance that no other records exist.
Is there a simple method to populate the form with records and leaving
the cursor at the bottom allowing data to be shown above.
Thanks in advance.
Re: Continious Form Display
am 26.11.2007 16:16:38 von Fred Zuckerman
"Clint Stowers" wrote in message
news:1403aa39-b938-4cc8-8693-85b136a51982@v4g2000hsf.googleg roups.com...
> Access 2003
>
> I have a Continuous Form. On Open I force it to go to the Last
> Record.
>
> When the form opens only the last record is shown at the top. To view
> any of the previous records you must scroll. This give the appearance
> at first glance that no other records exist.
>
> Is there a simple method to populate the form with records and leaving
> the cursor at the bottom allowing data to be shown above.
>
> Thanks in advance.
Right after your code that moves to the last record, try moving up 5
records:
DoCmd.MovePrevious
DoCmd.MovePrevious
DoCmd.MovePrevious
DoCmd.MovePrevious
DoCmd.MovePrevious
Fred Zuckerman
Re: Continious Form Display
am 26.11.2007 16:51:55 von lyle
On Nov 26, 10:07 am, Clint Stowers wrote:
> Access 2003
>
> I have a Continuous Form. On Open I force it to go to the Last
> Record.
>
> When the form opens only the last record is shown at the top. To view
> any of the previous records you must scroll. This give the appearance
> at first glance that no other records exist.
>
> Is there a simple method to populate the form with records and leaving
> the cursor at the bottom allowing data to be shown above.
>
> Thanks in advance.
This works in Access 2002 with the Product List Form in the Northwind
Database.
Private Sub Form_Load()
' requires a reference to ADODB
Dim r As ADODB.Recordset
Set r = New ADODB.Recordset
Dim z As Long
With r
.ActiveConnection = CurrentProject.Connection
.CursorLocation = adUseClient
.CursorType = adOpenStatic
.LockType = adLockBatchOptimistic
.Open "SELECT * FROM Products"
.MoveLast
On Error Resume Next
For z = 0 To (Me.InsideHeight \ Me.Detail.Height) - 2
.MovePrevious
Next z
On Error GoTo 0
End With
Set Me.Recordset = r
DoCmd.RunCommand acCmdRecordsGoToLast
End Sub
This is not tested code, nor is it recommended for non-coders. But
it's fun.
Re: Continious Form Display
am 26.11.2007 23:48:47 von Stephen Lebans
You can achieve complete control via the Form's SelTop property. See:
http://www.lebans.com/setgetsb.htm
SetGetSB.zip is a database containing functions to allow a user to Set or
Get the current position of a ScrollBar Thumb for a Form.
NEW - Apr. 02/2000 The current ScrollBar position is equal to the current
Record Number being displayed at the Top of the Form.
Works in Form or Datasheet view.
Ver 1.7
Fix bug in SelTop method. Now works with first page of rows properly and
sets the Top row correctly when moving forward in the recordset one row at a
time.
Ver 1.6
Use SelTop to save Restore current row's position after a Requery.
Ver 1.5
Added support for Horizontal ScrollBars.
--
HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
"Clint Stowers" wrote in message
news:1403aa39-b938-4cc8-8693-85b136a51982@v4g2000hsf.googleg roups.com...
> Access 2003
>
> I have a Continuous Form. On Open I force it to go to the Last
> Record.
>
> When the form opens only the last record is shown at the top. To view
> any of the previous records you must scroll. This give the appearance
> at first glance that no other records exist.
>
> Is there a simple method to populate the form with records and leaving
> the cursor at the bottom allowing data to be shown above.
>
> Thanks in advance.