Results 1 to 2 of 2
2008-11-05, 07:09 #1
- Join Date
- Mar 2004
- Thanked 0 Times in 0 Posts
New record, view previous records (2003)
Hi, I have a form that opens in "continuous forms" view and can have code in the On Open event to move to a new record via "DoCmd.GoToRecord , , acNewRec".
The problem here is that only the new record is displayed in the detail section, any previous records have scrolled up and so not visible to the user. This creates a degree of confusion for some users who, without realising they could scroll up, think there are no records in the form. I am looking for a tidy way to have as many records visible as practical in the space available. One method involves something like the following lines:
DoCmd.GoToRecord , , acLast
DoCmd.GoToRecord , , acPrevious, 10
DoCmd.GoToRecord , , asNewRec
Which will display the last 10 records and put the focus in the new record. This only works if there are more than 10 records! Is there a better way of doing this so that I don't have to specify the offset (10 in this example) and I display as many records as will fit in the space available? Or, to trap the error so that if there aren't enough records, that it moves some lesser number?
2008-11-05, 07:20 #2
- Join Date
- Mar 2002
- Thanked 30 Times in 30 Posts
Re: New record, view previous records (2003)
See if you can use the idea from my last reply in the thread that begins at <post:=740,337>post 740,337</post:>.