473,408 Members | 2,399 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.

Set focus to a subform in a tab control

I've looked all over the internet and I couldn't find anything that helped me.

I have a main form called: Patient Information
On this form I have a subform called: [name_Age Qry_form]
and a field in this form is: [Age]

Also on this form is a Tab Control called: [TabCtl38]
The First tab is called: [Contact Info]
and on this tab is a subform called: [Contact Info_tab]
and on this subform is a field called: [DOB]

If someone clicks on the age to try and change it, i have a message box that pops up telling them to edit the DOB because the age will automatically populate.
Now I'm trying to set the focus to the DOB field so they can enter the date. How do i do this?

This is what I tried:
Expand|Select|Wrap|Line Numbers
  1. Private Sub Age_GotFocus()
  2. Forms![Contact Info_tab].Form!DOB.SetFocus
  3. MsgBox "To edit their age, edit their DOB under the Contact Info tab.  Their age will automatically update once their DOB is entered or adjusted.", vbInformation, "Age updates automatically"
  4. End Sub
  5.  
Apr 6 '11 #1

✓ answered by Rabbit

The age subform isn't going to be able to see the contact subform. What you'll have to do is go to the parent of the age subform and then go to the contact subform from there.

2 2827
Rabbit
12,516 Expert Mod 8TB
The age subform isn't going to be able to see the contact subform. What you'll have to do is go to the parent of the age subform and then go to the contact subform from there.
Apr 6 '11 #2
oh, ok that makes sense, thanks Rabbit. I should be able to figure that out.
Apr 6 '11 #3

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

Similar topics

0
by: Sabine Oebbecke | last post by:
Hi Experts! I have several forms and reports where controls get their values with 'Forms!MainForm!Control' or 'Forms!MainForm!Subform!Control' resp 'Forms!MainForm!Subform.Form!Control' which...
12
by: MLH | last post by:
I have created two forms: frmBrowseNegsMainform and frmBrowseNegsSubform. I put a subform control on the first of these. The SourceObject property for the subform control is, of course,...
3
by: Melissa | last post by:
I have forty-two small subforms on a form. I need help with the code that will return the name of the subform control when I click on any subform control. I know how to select all the subform...
0
by: Toni | last post by:
I need to be able to click on a subform control and open a form in acDialog mode. A subform control only has an Enter event and when I try that the code executes again when focus returns to the...
10
by: Sally | last post by:
When I click on a control in a subform, what is the syntax to return the name of the subform control on the main form that contains the subform? MsgBox "MySubform is in " & < ???? > Thanks, ...
6
by: MLH | last post by:
When the vehicle entry form (frmVehicleEntryForm) first opens, the additional owner SubForm control (frmAddnlOwnrListSubForm) is enabled. You can click on it and it will accept the focus. But after...
1
by: MLH | last post by:
I have a form with a subform control on it listing records returned by a saved query named UnbilledVehicles. I would like to put command buttons on the main form to apply dynamic filters to the...
8
by: kevin.vaughan | last post by:
Good Afternoon Everyone, Could someone please explain why I can't set the Subform control Visible attribute to False as below? The statement for the locked attributes work but not for the...
3
by: ApexData | last post by:
I am using the Shortcut Menu Bar property of many combobox controls to execute a single shared custom function. When the function executes, I need it to immediately identify the following items:...
1
by: veteranwebdesign | last post by:
Hello, I have a main form. I want forms to open in a subform control box. What is the code for the option group to open the subforms in the control box. I didn't create subforms, I created...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.