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. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
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
|
|||
|
|||
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 | |
|
|