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  

Tabbing between subforms using datasheet view



 
 
Thread Tools Display Modes
  #1  
Old December 28th, 2006, 07:31 PM posted to microsoft.public.access.forms
Rocky Beach
external usenet poster
 
Posts: 8
Default Tabbing between subforms using datasheet view

I have a form with four subforms using the Datasheet default view for each.
I am having difficulty creating a cohesive tab order.
The subforms have various numbers of fields, but what I would like is
constant. I am trying to set the focus on the first field of a new record
row for each subform. When tabbing from the last field of a record in one
subform, I am trying to get my focus to be set on the next adjacent subform,
new record row, field one instead of it creating a new record within the
current subform. I have tried using the setfocus function and the lost
focus, on got focus, and on activate events. But I have been unsuccessful so
far in getting my tabs to flow smoothly.
Any help would be greatly appreciated.

  #2  
Old December 29th, 2006, 04:35 AM posted to microsoft.public.access.forms
strive4peace
external usenet poster
 
Posts: 1,670
Default Tabbing between subforms using datasheet view

Hi Rocky,

Here is some code to switch to another subform when TAB is pressed in a
particular control...

'~~~~~~~~~~~~~~~~~~
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

'~~~~~~~~~~~~~~~~~~

on adding a new record...
The problem with using
DoCmd.GoToRecord , , acNewRec

is that you are not explicitly specifying WHERE to add the record...so
use the Recordset AddNew method instead

'~~~~~~~~~~~~~~~~~~

'add new record to another subform
me.parent.SubformControlname.Form.Recordset.AddNew

'~~~~~~~~~~~~~~~~~~


Warm Regards,
Crystal
*
(: have an awesome day
*
MVP Access
Remote Programming and Training
strive4peace2006 at yahoo.com
*



Rocky Beach wrote:
I have a form with four subforms using the Datasheet default view for each.
I am having difficulty creating a cohesive tab order.
The subforms have various numbers of fields, but what I would like is
constant. I am trying to set the focus on the first field of a new record
row for each subform. When tabbing from the last field of a record in one
subform, I am trying to get my focus to be set on the next adjacent subform,
new record row, field one instead of it creating a new record within the
current subform. I have tried using the setfocus function and the lost
focus, on got focus, and on activate events. But I have been unsuccessful so
far in getting my tabs to flow smoothly.
Any help would be greatly appreciated.

 




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 07:18 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.