UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
 
   Reply to this topicStart new topic
> How To Position New Record At Bottom Of Continuous Form?, Access 2016    
 
   
appro
post Nov 14 2017, 01:19 AM
Post#1



Posts: 158
Joined: 23-January 05



I've been searching for an answer to this and have turned up nothing. I have a button on a continuous form that takes the user to a new record. Some users are confused by the fact that the new record appears at the top of the continuous form with blank space underneath.

Is there a simple way to force the new record to appear at the bottom of the continuous form, with previously entered records showing above it, regardless of the computer screen size being used?
Go to the top of the page
 
Peter Hibbs
post Nov 14 2017, 03:58 AM
Post#2


UtterAccess VIP
Posts: 1,424
Joined: 17-June 10
From: Dorset. UK.


Hi appro,

This is the code I use :-

CODE
Private Sub cmdNewRecord_Click()

Dim vCount As Long

    vCount = Me.frmSubform.Form.RecordsetClone.RecordCount - 35 'fetch No of records - No of rows
    Me.frmSubform.Form.SelTop = vCount                          'set top row of Continuous form
    
    Me.frmSubform.SetFocus                                      'move focus to subform
    DoCmd.GoToRecord , , acNewRec                                   'go to new record
    Me.frmSubform!FieldName.SetFocus                             'move focus to first field

End Sub


With this example the Continuous form is on a main form and the button (cmdNewRecord) is on the main form. If you have the same set up then just replace the name frmSubform with the name of your subform and also replace the field name FieldName with the name of the field that you want have the focus.

If the button is on the Continuous form itself then you should remove the references to the subform. Also, the number 35 is the number of visible rows on the Continuous form less one so you should change this number to whatever is appropriate for your form.

HTH

Peter Hibbs.
Go to the top of the page
 
appro
post Nov 14 2017, 04:06 AM
Post#3



Posts: 158
Joined: 23-January 05



Thanks Peter. The only issue that I may have with this is with varying screen sizes. User screen sizes vary from large monitors to 14" laptop screens. I'll have a play and see how I go.
Go to the top of the page
 
missinglinq
post Nov 14 2017, 08:48 AM
Post#4



Posts: 4,386
Joined: 11-November 02



Screen size doesn't matter...it's the screen resolution, on different machine, that can present a problem! There are a number of hacks out there, many of them freeware, that address this problem. The only real caveat is that they all work best when resizing Forms up...meaning that it is best to develop your app in the lowest screen resolution you are likely to encounter.

Linq ;0)>

--------------------
Hope this helps!

The problem with making anything foolproof...is that fools are so darn ingenious!

All posts/responses based on Access 2003/2007
Go to the top of the page
 


Custom Search
RSSSearch   Top   Lo-Fi    24th November 2017 - 07:58 AM