469,903 Members | 1,695 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,903 developers. It's quick & easy.

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 14318
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 discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Daron | last post: by
1 post views Thread by Waqarahmed | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.