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  

Button to navigate through subforms



 
 
Thread Tools Display Modes
  #1  
Old May 2nd, 2008, 02:18 PM posted to microsoft.public.access.forms
Access Joe
external usenet poster
 
Posts: 118
Default Button to navigate through subforms

In an environment that contains mutliple forms and subforms, when you reach
the end of the last subform, you have to manually click out to get to the
next main record. Can you create an automated way of navigating through
subforms so people don't have to know about CTRL/TAB when they want to go
from form to form, and so when they reach the end, all they have to do is hit
tab to move to the next main record?

Thanks so much!
  #2  
Old May 3rd, 2008, 08:42 PM posted to microsoft.public.access.forms
strive4peace
external usenet poster
 
Posts: 1,670
Default Button to navigate through subforms

Hi Joe,

use the key press event and trap for a TAB

to go to another subform:

'~~~~~~~~~~~~~~~~~
Private Sub Controlname_KeyPress(KeyAscii As Integer)
If KeyAscii = 9 Then
Me.Parent.SubformControlname.SetFocus
Me.Parent.SubformControlname.form.Controlname.SetF ocus
End If
End Sub
'~~~~~~~~~~~~~~~~~

to go to the parent form and then to the next record (this is not
tested!), try this:

'~~~~~~~~~~~~~~~~~
Private Sub Controlname_KeyPress(KeyAscii As Integer)
If KeyAscii = 9 Then
Me.Parent.SubformControlname.SetFocus
Me.Parent.recordset.movenext
End If
End Sub
'~~~~~~~~~~~~~~~~~

this will have an error if you are already on the last record -- it can
be handled, but I did not want to overload you with code right now --
basics first smile


Warm Regards,
Crystal

Access Basics
8-part free tutorial that covers essentials in Access
http://www.accessmvp.com/Strive4Peace/Index.htm

*
(: have an awesome day
*



Access Joe wrote:
In an environment that contains mutliple forms and subforms, when you reach
the end of the last subform, you have to manually click out to get to the
next main record. Can you create an automated way of navigating through
subforms so people don't have to know about CTRL/TAB when they want to go
from form to form, and so when they reach the end, all they have to do is hit
tab to move to the next main record?

Thanks so much!

 




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 03:56 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.