Counterpart to VBA "Me"

  • Thread starter Thread starter Gary Schuldt
  • Start date Start date
G

Gary Schuldt

Is there a way in an event handler macro to refer to the current form and
the current active control?

For example, I would like to code something like:

SetValue Me.ActiveControl to Ucase(Me.ActiveControl)

Right now, the only way I've been able to get run-time to stop asking for a
parameter value is to use fully-qualified references, which gets to be
tedious when you're in subforms.

Thanks.

Gary
 
"me" should work in a subform, same as it does in a main form. i'm not sure
where you're running the code, or exactly what code you're using, but you
could try this

Me.ActiveControl = UCase(Me.ActiveControl)

in a procedure on the control's After Update event.

hth
 
Tina,

the VBA code works fine; I'd just like to know how to do it in a Macro as
well!

Gary
 
No, you use Screen instead. :-)

Action: SetValue
Item: [Screen].[ActiveControl]
Expression: StrConv([Screen].[ActiveControl],1)
 
re: Screen vs Me

I also see it's StrConv instead of Ucase.

Gee, I get to use a Whole New Language!

Perhaps all I really need is the source code for the program that converts
macros to procedures!

Thanks once again, Steve. I think I can use that macro code for ANY text I
need capitalized.

Gary

Steve Schapel said:
No, you use Screen instead. :-)

Action: SetValue
Item: [Screen].[ActiveControl]
Expression: StrConv([Screen].[ActiveControl],1)

--
Steve Schapel, Microsoft Access MVP


Ken said:
You can't use Me in a macro.
 
Actually, UCase works here too.

--
Ken Snell
<MS ACCESS MVP>

Gary Schuldt said:
re: Screen vs Me

I also see it's StrConv instead of Ucase.

Gee, I get to use a Whole New Language!

Perhaps all I really need is the source code for the program that converts
macros to procedures!

Thanks once again, Steve. I think I can use that macro code for ANY text I
need capitalized.

Gary

Steve Schapel said:
No, you use Screen instead. :-)

Action: SetValue
Item: [Screen].[ActiveControl]
Expression: StrConv([Screen].[ActiveControl],1)

--
Steve Schapel, Microsoft Access MVP


Ken said:
You can't use Me in a macro.
 
Ken,

good to know! Thanks.

Gary

Ken Snell said:
Actually, UCase works here too.

--
Ken Snell
<MS ACCESS MVP>

Gary Schuldt said:
re: Screen vs Me

I also see it's StrConv instead of Ucase.

Gee, I get to use a Whole New Language!

Perhaps all I really need is the source code for the program that converts
macros to procedures!

Thanks once again, Steve. I think I can use that macro code for ANY
text
I
need capitalized.

Gary

Steve Schapel said:
No, you use Screen instead. :-)

Action: SetValue
Item: [Screen].[ActiveControl]
Expression: StrConv([Screen].[ActiveControl],1)

--
Steve Schapel, Microsoft Access MVP


Ken Snell wrote:
You can't use Me in a macro.
 
Back
Top