Referring to controls as Me??

G

Guest

I want to create a macro that will upon double-clicking a control.. set the
value of the control to Todays Date. I want to create ONE macro that can be
called from any control that I assign it to.

In the macro window I think I want to use the SETVALUE action.

Item: ?????????????? <<-- what goes here?
Expression: Date()

Can someone tell me the syntax to put in as the item... something like Me!
... but I don't know how to make it work.

Thanks

tp
 
G

Guest

Hi Title - can't do it that way - the help for SetValue Item line says

The name of the field, control, or property whose value you want to set.
Enter the field, control, or property name in the Item box in the Action
Arguments section of the Macro window. You must use the full syntax to refer
to this item, such as controlname (for a control on the form or report from
which the macro was called) or Forms!formname!controlname. This is a required
argument.

It would therefore be different for each control.

Why do you want a macro and not code? I also shy away from coding but with
little things like this it can be it's the only way to do it. Once you get
the line of code you can copy and paste it whereever its needed or make it
universal and call it from everywhere.

Yours - Dika
 
G

Guest

Thank you.
I am a crummy coder... so I live in a macro world! I have coded.. but as
last resort and I no longer have time to learn or stay up with programming.

If you know what the code is I can put it into the doubleclick property. Do
you know what it should look like?

Thanks,

tp
 
S

Steve Schapel

TP,

In the Item argument of your SetValue macro action, put...
[Screen].[ActiveControl]
 

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