Continuous form record display?

B

Bob Hughes

I am using Access 2K and have a bound Continuous Form for entering new
data. The form open routine is.

Private Sub Form_Open(Cancel As Integer)
DoCmd.GoToRecord , , acNewRec
mem_ID.SetFocus
End Sub

Currently only the previous record is displayed when the form is opened.
I would like this new record to be at the bottom of the page, so a full
page of previous records are displayed.
Is there a way of doing this?

Bob
 
M

Marshall Barton

Bob said:
I am using Access 2K and have a bound Continuous Form for entering new
data. The form open routine is.

Private Sub Form_Open(Cancel As Integer)
DoCmd.GoToRecord , , acNewRec
mem_ID.SetFocus
End Sub

Currently only the previous record is displayed when the form is opened.
I would like this new record to be at the bottom of the page, so a full
page of previous records are displayed.


I think you may need to wait for the Load event when the
form's records have been loaded.

When you change the current record, and if that record is
not displayed in the form's window, Access automatically
scrolls that record to near the top of the form (as you are
seeing). To display additional records, you must do
something to scroll backwards to display an earlier record.
If you don't scroll backwards too far then you can "go to"
the new record again and it will stay where it is.

For example, if the form can display 7 records, then you can
use something like this trivial outline of the needed code:
DoCmd.GoToRecord , , acNewRec
With Me.RecordsetClone
.Move -6
End With
DoCmd.GoToRecord , , acNewRec

But, a more general approach might be better. Take a look
at http://www.lebans.com/setgetsb.htm for a far more
thorough approach to manipulating the scrolling in a form.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top