How do I refer to the current field

O

OD

How did I refer to the current field, or get it field name in a form.

As I move through a form I sometimes need to get the current field or
textbox name. To do something like change its value.

Thanks
OD
 
F

fredg

How did I refer to the current field, or get it field name in a form.

As I move through a form I sometimes need to get the current field or
textbox name. To do something like change its value.

Thanks
OD


For the name of the control that has the Focus:
msgbox Screen.ActiveControl.Name

For the name of the previous control that had the focus:
MsgBox Screen.PreviousControl
 
J

John W. Vinson

How did I refer to the current field, or get it field name in a form.

As I move through a form I sometimes need to get the current field or
textbox name. To do something like change its value.

Thanks
OD

Do you want to change the *name* of the field in the table, or the control on
the form? That would be rather unusual. What's the context? What specifically
do you have on the form, how are you moving through it, and what do you want
to change?
 
O

OD

Fredg answer was what I needed.

Thanks

John W. Vinson said:
Do you want to change the *name* of the field in the table, or the control on
the form? That would be rather unusual. What's the context? What specifically
do you have on the form, how are you moving through it, and what do you want
to change?
 
O

OD

Thanks Fred it was just what I neede.

fredg said:
For the name of the control that has the Focus:
msgbox Screen.ActiveControl.Name

For the name of the previous control that had the focus:
MsgBox Screen.PreviousControl
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top