469,904 Members | 2,078 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,904 developers. It's quick & easy.

Subform Lost Focus Next Record Error

I created a code that would take me from the last field in a subform and take me to the next record first field on the parent form. Unfortunately, there is a little snag if I try to use the mouse to click into the subform from the parent form. It takes me to the next record again instead of just allowing me to click into the subform for that record. If I just tab, everything is fine, but this db is being used by others that may not remember or understand to use the tab function. Is there a way to fix this code?

Thanks in advance!

Expand|Select|Wrap|Line Numbers
  1. Private Sub Remove_Account_From_LostFocus()
  2.    Me.Parent![SAP Postal Code].SetFocus
  3.   DoCmd.GoToRecord , , acNext
  4. End Sub
May 12 '10 #1

✓ answered by Jim Doherty

@sblakethomas
You need to check your subform tab orders and sequence things so that some 'other' control gets the focus 'before' you leave the subform so that when you click back into the subform (which gets first focus) focus is then then passed to the first control in the tab order

Expand|Select|Wrap|Line Numbers
  1. Me!The_First_Control_In_Your_Tab_Sequence_Name.Setfocus
  2. Me.Parent![SAP Postal Code].SetFocus 
  3.  DoCmd.GoToRecord , , acNe
xt

1 2147
Jim Doherty
897 Expert 512MB
@sblakethomas
You need to check your subform tab orders and sequence things so that some 'other' control gets the focus 'before' you leave the subform so that when you click back into the subform (which gets first focus) focus is then then passed to the first control in the tab order

Expand|Select|Wrap|Line Numbers
  1. Me!The_First_Control_In_Your_Tab_Sequence_Name.Setfocus
  2. Me.Parent![SAP Postal Code].SetFocus 
  3.  DoCmd.GoToRecord , , acNe
xt
May 21 '10 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

3 posts views Thread by William Wisnieski | last post: by
2 posts views Thread by Gerry Abbott | last post: by
3 posts views Thread by Lynx101 | last post: by
reply views Thread by Salome Sato | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.