473,408 Members | 1,951 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

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 2346
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

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

Similar topics

3
by: Warmonkey | last post by:
Hi there, I have been frustrated by the 'next record' problem when a user tabs off the last control on a form. I have tried a couple of the suggestions listed on the newsgroup, but so far...
1
by: entellisys | last post by:
Hi there, Does anyone know the simplest way I can trap the next record event in Access 2000 on a subform? I have a main form with tab control which holds several subforms, and the subforms...
3
by: William Wisnieski | last post by:
Hello Everyone, Access 2000, I have a main unbound form with a bound datasheet subform . The subform is bound to a query that returns records based on criteria in the main form. The user...
15
by: Susan Bricker | last post by:
Greetings. I have a Mainform with a subform. The Mainform has single record format and subform has continuous form format. When the Mainform opens, I force allowadditions and allowedits to FALSE...
2
by: Gerry Abbott | last post by:
Hi all, Ive got a bound form (its actually a subform), but want to ensure that a specific field is populated before the user can move away from that record. Can anyone suggest the best method...
1
by: Reginald Bal | last post by:
Main Form/SubForm When I requery or recalc my parent form after I updated a record in my subform, I lose the focus of that particular record in my subform. Instead, the first record is selected....
1
by: Tony Dunn | last post by:
I have inherited another developer's database (Access 2003) and with it a problem I'm struggling with. The problem is this. I have a parent-child form pair, which is populated by a table (the...
2
by: gavm360 | last post by:
Hello, I have a data entry form that has a button to copy the values of fields (CASECODE,STEPDES,CBOANSWER) into the fields (CASECODE,STEPDES,ANSWER) of a subform on the page. Private Sub...
1
by: stuart | last post by:
I have a list of records in a subform that a user can either edit or delete. This is an unbound form. If the user deletes a record, I want to refresh the form, and then position the cursor on the...
3
by: Lynx101 | last post by:
I am trying to move a subform onto the next record with: DoCmd.GoToRecord acForm, "MaintainAssets_edit", acNext but when I do this I get "The object 'MaintainAssets_edit' is isn't open". I...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.