473,609 Members | 1,851 Online
Bytes | Software Development & Data Engineering Community
+ 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_l ist" 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 2048
missinglinq
3,532 Recognized Expert Specialist
Should be

y = Application.Scr een.PreviousCon trol.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.Scr een.PreviousCon trol.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.Scr een.PreviousCon trol.Value

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

Content = Application.Scr een.PreviousCon trol

will work just as well!

Linq ;0)>
May 9 '08 #4
wassimdaccache
222 New Member
Content = Application.Scr een.PreviousCon trol.Value

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

Content = Application.Scr een.PreviousCon trol

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
10426
by: Paul Thompson | last post by:
How do I determine in JavaScript the name of the object that focus is on?
4
2182
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 select to the invalid field to force the user to correct the entry. A simple example is at www.brilley.co.uk/TestInfo.htm The problem is that this example works in IE but not in NN or Safari, which do not return focus or select back to the...
1
3422
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 the main after submit?
5
5627
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 for input. Under the "Case vbYes" I indicated the two required fields to return the focus, based on which one is empty, however, I cannot seem to return the focus. If I only have one field indicated in the code, example; If Me.txtUDateStart =...
4
19044
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 there an easy way to do this or would I have to check for all keypresses in an event somewhere and manually set the focus on Button1 if the RETURN key was hit. Is so, which event would that be?
13
3994
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 "false" on it. What the ?!?!?! To test, I commented out the 'return false;' code in the second IF block, so now if there is a value in Name then I get the alert message for Email and the page stays put.
4
3814
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 document.FormName.P\.LAST_NAME.focus() should do the job, but it doesn't. I've tried a number of variations, with no success, so far. I could recode my application to use a character other than "." in that element name (yes, I was asking for trouble) but I'd prefer...
1
2285
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 user clicks on alert box it submits the form instead of focusing to desired field... I have cascade style webform .so if havent filled field in 2nd sheet and i click on submit button in 4 sheet.. it prompts the alert box but does not focus to 2nd...
7
1888
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 is called It works properly in Firefox but not in IE. solutions???
0
8139
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8091
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
7024
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6064
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5524
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4032
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2540
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1686
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1403
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.