A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Open Continuous form with a few lines showing



 
 
Thread Tools Display Modes
  #1  
Old May 5th, 2010, 01:44 AM posted to microsoft.public.access.forms
neil40[_2_]
external usenet poster
 
Posts: 28
Default Open Continuous form with a few lines showing

Hi

I have successfully implemented a continuous form to open at a new
line with
RunCommand acCmdRecordsGoToNew
in the Load Event

However, you have to manually scroll a little to see a few of the
previous records.
It would be nice to see up to 5 of these previous lines on Opening the
form

Is there a way to modify this code to do that?

Thanks
Neil
  #2  
Old May 5th, 2010, 02:16 AM posted to microsoft.public.access.forms
Arvin Meyer [MVP][_2_]
external usenet poster
 
Posts: 2,310
Default Open Continuous form with a few lines showing

Change the form's underlying record source to a Top 5 query.

In a query's design view, right click in a blank area, and choose
properties. Set the Top Values to 5, then adjust your criteria and order by
clause to return the records you want. Use that query as your form's record
source.
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.accessmvp.com
http://www.mvps.org/access


"neil40" wrote in message
...
Hi

I have successfully implemented a continuous form to open at a new
line with
RunCommand acCmdRecordsGoToNew
in the Load Event

However, you have to manually scroll a little to see a few of the
previous records.
It would be nice to see up to 5 of these previous lines on Opening the
form

Is there a way to modify this code to do that?

Thanks
Neil



  #3  
Old May 5th, 2010, 10:40 AM posted to microsoft.public.access.forms
neil40[_2_]
external usenet poster
 
Posts: 28
Default Open Continuous form with a few lines showing

On 5 May, 02:16, "Arvin Meyer [MVP]" wrote:
Change the form's underlying record source to a Top 5 query.

In a query's design view, right click in a blank area, and choose
properties. Set the Top Values to 5, then adjust your criteria and order by
clause to return the records you want. Use that query as your form's record
source.
--
Arvin Meyer, MCP, MVPhttp://www.datastrat.comhttp://www.accessmvp.comhttp://www.mvps.org/access

"neil40" wrote in message

...



Hi


I have successfully implemented a continuous form to open at a new
line with
RunCommand acCmdRecordsGoToNew
in the Load Event


However, you have to manually scroll a little to see a few of the
previous records.
It would be nice to see up to 5 of these previous lines on Opening the
form


Is there a way to modify this code to do that?


Thanks
Neil- Hide quoted text -


- Show quoted text -


I'll give it a try Arvin, but not quite what I want.
I like the whole set of data being available to me in the continuous
form, and wanted the 'new' line to appear with a few 'old' lines
ideally.
I can certainly scroll if necessary, to check where I left off, but if
it could be 'automatic' that would be better.

I presuming that your solution only returns the lst 5 records?

Neil
  #4  
Old May 5th, 2010, 01:22 PM posted to microsoft.public.access.forms
Linq Adams via AccessMonster.com
external usenet poster
 
Posts: 1,474
Default Open Continuous form with a few lines showing

This should do the job

Private Sub Form_Load()
DoCmd.RunCommand acCmdRecordsGoToNew
For i = 1 To 5
DoCmd.GoToRecord , , acPrevious
Next i
End Sub

--
There's ALWAYS more than one way to skin a cat!

Answers/posts based on Access 2000/2003

Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...forms/201005/1

  #5  
Old May 5th, 2010, 01:25 PM posted to microsoft.public.access.forms
Linq Adams via AccessMonster.com
external usenet poster
 
Posts: 1,474
Default Open Continuous form with a few lines showing

As an afterthought, you might want to check that you have at least 5 record
before executing the

For i = 1 To 5
DoCmd.GoToRecord , , acPrevious
Next i

--
There's ALWAYS more than one way to skin a cat!

Answers/posts based on Access 2000/2003

Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...forms/201005/1

  #6  
Old May 5th, 2010, 05:45 PM posted to microsoft.public.access.forms
John W. Vinson
external usenet poster
 
Posts: 18,261
Default Open Continuous form with a few lines showing

On Wed, 05 May 2010 12:25:53 GMT, "Linq Adams via AccessMonster.com"
u28780@uwe wrote:

As an afterthought, you might want to check that you have at least 5 record
before executing the

For i = 1 To 5
DoCmd.GoToRecord , , acPrevious
Next i


Or just trap and ignore the "you cannot go to this record" error.
--

John W. Vinson [MVP]
  #7  
Old May 5th, 2010, 08:15 PM posted to microsoft.public.access.forms
neil40[_2_]
external usenet poster
 
Posts: 28
Default Open Continuous form with a few lines showing

On May 5, 1:22*pm, "Linq Adams via AccessMonster.com" u28780@uwe
wrote:
This should do the job

Private Sub Form_Load()
* DoCmd.RunCommand acCmdRecordsGoToNew
*For i = 1 To 5
* *DoCmd.GoToRecord , , acPrevious
*Next i
End Sub

--
There's ALWAYS more than one way to skin a cat!

Answers/posts based on Access 2000/2003

Message posted via AccessMonster.comhttp://www.accessmonster.com/Uwe/Forums.aspx/access-forms/201005/1


Linq

Thanks for this, the first line returned an error so I took out the
DoCmd and now it works.
Furthermore, I added another loop to take the cursor back down to the
input line

So it now reads:
Private Sub Form_Load()
RunCommand acCmdRecordsGoToNew
For i = 1 To 5
DoCmd.GoToRecord , , acPrevious
Next i
For j = 1 To 5
DoCmd.GoToRecord , , acNext
Next j
End Sub

Perfect!

Neil
  #8  
Old May 5th, 2010, 08:56 PM posted to microsoft.public.access.forms
Linq Adams via AccessMonster.com
external usenet poster
 
Posts: 1,474
Default Open Continuous form with a few lines showing

Glad you got it working!

--
There's ALWAYS more than one way to skin a cat!

Answers/posts based on Access 2000/2003

Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...forms/201005/1

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 09:57 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.