473,486 Members | 1,862 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

How can I return the name of the field that I had the focus on

222 New Member
Hello guys,

I am trying to search in a form name "employee_list" every unique field.

The idea is to return the name of the field that had the focus

I am trying to write this
Expand|Select|Wrap|Line Numbers
  1.  Dim y As Variant
  2.  y = Application.Screen.PreviousControl.focused
  3. x = InputBox("Please Enter Your Critiria", "Filter Product List")
  4. DoCmd.OpenForm "employee_list", , , "[y] LIKE '" & [x] & "*'"
  5.  
I am getting in a error with.

Expand|Select|Wrap|Line Numbers
  1.  y = Application.Screen.PreviousControl.focused

Please advise me

Thank you in advance


WASSIM S DACCACHE
May 9 '08 #1
5 2038
missinglinq
3,532 Recognized Expert Specialist
Should be

y = Application.Screen.PreviousControl.Name


The fact that the f in focused wasn't capitalized when you moved off the line tells you that focused isn't a valid property.

Linq ;0)>
May 9 '08 #2
wassimdaccache
222 New Member
Should be

y = Application.Screen.PreviousControl.Name


The fact that the f in focused wasn't capitalized when you moved off the line tells you that focused isn't a valid property.

Linq ;0)>
Appreciate you feedback.

Could you please help me by getting the data of the previous field focused.
I mean the content (data)

by the way why on my access vb page when I write previouscontrol and then DOT a combo will automatically expand and it is not containing the "name" property.
Thank you in advance


Best Regards;

WASSIM S DACCACHE
May 9 '08 #3
missinglinq
3,532 Recognized Expert Specialist
Content = Application.Screen.PreviousControl.Value

and actually, the .Value is not neccessary, as Value is the Default Property of textboxes, comboboxes, etc. so

Content = Application.Screen.PreviousControl

will work just as well!

Linq ;0)>
May 9 '08 #4
wassimdaccache
222 New Member
Content = Application.Screen.PreviousControl.Value

and actually, the .Value is not neccessary, as Value is the Default Property of textboxes, comboboxes, etc. so

Content = Application.Screen.PreviousControl

will work just as well!

Linq ;0)>

It works I appreciate you quick reply :)


THANK YOU VERY MUCH


TAKE CARE
May 9 '08 #5
missinglinq
3,532 Recognized Expert Specialist
Glad we could help!

Linq ;0)>
May 9 '08 #6

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

Similar topics

4
10418
by: Paul Thompson | last post by:
How do I determine in JavaScript the name of the object that focus is on?
4
2171
by: Roger Withnell | last post by:
I want to validate the data entered into a form text field by calling a function with onblur, doing the validation and, if the input is invalid, giving an alert to the user and returning focus and...
1
3401
by: Piotr | last post by:
I have popup window (window.open) where I put any value in input field. After submit I wan to to return to the main window and get value from popup window. How to close popup window and return to...
5
5619
by: Dave Brydon | last post by:
I'm checking for required fields, and using the code below, which I normally have no difficulties with; however, as a twist I decided to return the focus back to the specific field(s) in question...
4
19038
by: Empire City | last post by:
My windows form has some text boxes and a two buttons, Button1 and Button2. The TAB key goes from field to field. When the user presses the RETURN key I want the focus to be moved to Button1. Is...
13
3982
by: kurtj | last post by:
Hello Gurus: I have a validation script (below) that is somehow messed up. If the Name field is blank, I get the alert message, then the browser window goes to a blank document with the word...
4
3812
by: Steve Swift | last post by:
I'm trying to give the focus to a field defined with: <INPUT TYPE=TEXT NAME=P.LAST_NAME> and I'm having a spot of bother with that "." in the field's name. I thought that...
1
2277
by: Sudarhan | last post by:
Hello frnds I have created a webbased form using asp and javascript .. while submitting the form i am validating the fields in the form .it validates the field and returns alert message. but when...
7
1882
by: vimal | last post by:
Hi guys, <input class="btn" type="submit" name="terminate" value="Terminate" onclick="return check_proc_sel()" /> i have returned false from check_proc_sel() but still the form's submit event...
0
7094
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
6964
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
7123
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
7173
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...
0
7305
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
5427
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,...
0
3066
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...
1
598
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
259
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.