473,503 Members | 1,674 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Is there a Form event that could can be used to return a selected controls name?

I am trying to get a label control on a form to display a control's name (i.e., field name from a table) when the control is selected. I know I can program each control's GotFocus event to do this but I am hoping there is some process using something like one of the Form's events to do this. However, it doesn't seem like selecting a control on the form triggers any of the Form's events.

In more detail, currently the GotFocus event of a combobox on the Form runs VBA code that uses the Screen.PreviousControl.Name to return the "selected field" name (i.e., the field that had the focus prior to selecting the combobox) and then runs code to populate the combobox's RowSource with a list of the unique values of the field from the underlying table. Then when a value is selected from the dropdown list, it filters the underlying table based on the combobox value. This all work great in my programming.

However, I would like some method of having a label next to the combobox display the selected field's name so they know what field they will be filtering by when they use the combobox before they even give the combobox the focus. Hopefully this makes sense.
Oct 15 '10 #1
1 1318
jimatqsi
1,271 Recognized Expert Top Contributor
Jim,
I think the OnEnter event is the one you want.

Jim
Oct 18 '10 #2

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

Similar topics

8
4917
by: CJack | last post by:
hy, I have an mdi application, i create a child form and I want to know when a button is pressed while that child form is loaded. I have this code: private void frmTestBaby_KeyUp(object sender,...
0
2546
by: Joeyej | last post by:
Hi - I'm trying to move/use a web form (containing some javascript field checks) previously hosted on a Windows 2000 server. However, the FORM METHOD="post..." command in the form (shown below)...
3
1929
by: Patrick | last post by:
I am dynamically creating TextArea and drop-down lists in ASP.NET using something like HtmlTextArea eachTextArea = new HtmlTextArea(); I tried to set the "name" of these TextAreas, etc. (e.g....
1
1427
by: al | last post by:
Hi, I have MDI form with 4 mdichild forms. I would like to enable Windows menu-item as more than 1 mdichild form loads. The problem i'm having is when MdiChildActivate event is raised, it does...
7
1372
by: Rich | last post by:
Hello, I have 10 textboxes on a form. I would like to validate text-data entry on each textbox. I was looking for a Form_Current event or Form_Change event but did not recognize any such...
4
7833
by: Volker Jobst | last post by:
Hi, Is there an event of windows.forms.form which informs me that the active control will be changed before it will be changed? Something like: Private Sub Form_Validating(ByVal sender As...
8
2532
by: ABC | last post by:
How to return the class name using static getter from a class? The base class as: class abcbase { .............. public static string ObjectName {
0
1038
by: dsvn1975 | last post by:
Hi All, I am working with .NET, and currently am structed up with small problem. My requirement is, I am selecting an Report in ReportDesigner Solution Explorer, and opening an Add-In Wizard. The...
5
6430
by: ncsthbell | last post by:
I hope I can explain this to make sense..... I have a form (datasheet) and the record source is TABLEA. TABLEA has 3 columns defined as required keys, COL1, COL2, COL3. When user is in row in...
7
2000
by: ismailc | last post by:
Good day; When I click anywhere on the form a particular button remains selected & focused. Even while i'm busy typing in another textbox the button looks as if it's being selected with a dark...
0
7074
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
7322
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6982
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
7451
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
4667
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...
0
3161
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3150
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
731
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
374
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.