By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,477 Members | 1,641 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,477 IT Pros & Developers. It's quick & easy.

getting the name of the current field on a form

P: n/a
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
Share this Question
Share on Google+
2 Replies


P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.