How do I refer to the current field

  • Thread starter Thread starter OD
  • Start date Start date
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
 
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
 
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?
 
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?
 
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
 
Back
Top