473,407 Members | 2,306 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,407 software developers and data experts.

getting the name of the current field on a form

Hi all.
Im using abbreviated field names on a form to optimise space, but would like
to display for example, the status bar text of the control, onto the form
header, when the control has the focus.

I'm trying to use the screen.activecontrol, with the oncurrent event, but am
getting an error that the expression requires the control to be in the
active window. im getting this error also when i move from one record to the
next .

I'm also looking to pass this result onto the control on a parent form using
the parent property.

Any help welcome

------------------------------------------------
Private Sub Form_Current()
Me.fldNameDisplayText = Screen.ActiveControl
End Sub
------------------------------------------------


Nov 13 '05 #1
2 15564
Try tje ActiveControl of the Form, instead of the Screen object, e.g.:

Me.fldNameDisplayText = Me.ActiveControl.Name

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Gerry Abbott" <pl****@ask.ie> wrote in message
news:_N***************@news.indigo.ie...
Hi all.
Im using abbreviated field names on a form to optimise space, but would
like to display for example, the status bar text of the control, onto the
form header, when the control has the focus.

I'm trying to use the screen.activecontrol, with the oncurrent event, but
am getting an error that the expression requires the control to be in the
active window. im getting this error also when i move from one record to
the next .

I'm also looking to pass this result onto the control on a parent form
using the parent property.

Any help welcome

------------------------------------------------
Private Sub Form_Current()
Me.fldNameDisplayText = Screen.ActiveControl
End Sub
------------------------------------------------

Nov 13 '05 #2
As usual, thanks Allen, for the prompt reply.

the active control works fine and im getting the tag property, but i've got
to call it from the got focus of each field (34 in all). Unless there is an
way?

Gerry Abbott
"Allen Browne" <Al*********@SeeSig.Invalid> wrote in message
news:42**********************@per-qv1-newsreader-01.iinet.net.au...
Try tje ActiveControl of the Form, instead of the Screen object, e.g.:

Me.fldNameDisplayText = Me.ActiveControl.Name

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Gerry Abbott" <pl****@ask.ie> wrote in message
news:_N***************@news.indigo.ie...
Hi all.
Im using abbreviated field names on a form to optimise space, but would
like to display for example, the status bar text of the control, onto the
form header, when the control has the focus.

I'm trying to use the screen.activecontrol, with the oncurrent event, but
am getting an error that the expression requires the control to be in the
active window. im getting this error also when i move from one record to
the next .

I'm also looking to pass this result onto the control on a parent form
using the parent property.

Any help welcome

------------------------------------------------
Private Sub Form_Current()
Me.fldNameDisplayText = Screen.ActiveControl
End Sub
------------------------------------------------


Nov 13 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Ray | last post by:
I'm sorry this is a long post but I though I had better include everything as I'm new to VB. I have a a form frmCalendarMain which has five subforms (unbound). Each form is a reservation...
3
by: Daron | last post by:
Is it possible to use a parameter as the field name, not just a criteria? Snippet of my SQL: SELECT Eval("!!.(0)") AS TestField, AS from qry_main The parameter will hold the name of the...
5
by: effendi | last post by:
I am trying to write a simple routine multiplying one value of a field to another. i.e cost1 multiple by cost2.. But since I have many lines of these, I want to write a function by accessing the...
5
by: jdzemke | last post by:
I am getting 'options' is null or not an object using when using a dynamic dataset with a dropdown list in an html form. I am filling-in a text field and filtering the values in the drop-down. ...
1
by: simbarashe | last post by:
Hie could someone please help me with getting and using the current page url. I have a function that gets the url, I want to use it with header(location : XXX) but it wont work. The code is as...
10
by: jonathan184 | last post by:
Hi I tried getting this to work through dreamweaver but it did not. So i found a n example on the internet , i followed everything exactly the search script does not work. Could somebody help me...
3
by: franc sutherland | last post by:
Hello, I have a report which I filter using the me.filter command in the OnOpen event. Me.Filter = "OrderID=" & Forms!variable_form_name! Me.FilterOn = True I want to be able to open that...
1
by: raghuvendra | last post by:
Hi I have a jsp page with 4 columns: namely Category name , Category order, Input field and a submit button. All these are aligned in a row. And Each Category Name has its corresponding Category...
7
vikas251074
by: vikas251074 | last post by:
I am getting error above in following code since few days giving tension day and night. How can I solve this? I am facing since Oct.25. in line no. 362 After doing a lot of homework, I am...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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
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
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
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.