HELP WITH MACROS!!!!

C

Chris

I am having some problems trying to get the macros to
run. All i want to do is have a sentence that gets
outputted with i push a button so i dont have to type it
500 times.

so for example if i push F5 i want THIS IS REALLY
CONFUSING to be outputted to the cell i am in on my
table. And if i push F6 i want WHY WONT THIS JUST WORK
to be outputted.

How do i set this up?

Thanks.

Chris
 
K

Ken Snell

Why not just run an update query that writes the value into the table's
field for 500 records?
 
G

Guest

Because i have to go through and look at each value then
decided how i want to classify it.
 
K

Ken Snell

If you're working directly in the table, then a macro won't work for you.

If you're working on a form, you can create a macro that will use the
SetValue action to put the desired sentence into a control on the form
(assuming that the control is bound to the field, then it would be written
to the underlying table). You could run that macro by assigning it to a
toolbar icon that you create and add to the toolbar. But it would need to be
specifically written for a form name and a control name. Or you could create
a shortcut menu (right-click of mouse) that is associated to the desired
control on the form, and then run the macro based on that menu.

Or, you could just copy the desired sentence (Ctrl+c) and paste it into the
fields (Ctrl+v) as needed.
 
S

Steve Schapel

Chris,

In addition to Ken's suggestions, you can do this with an AutoKeys
macro. Make a macro, name it AutoKeys, and if you can't see a Macro
Name column in the macro design window, enable it from the View menu.
Using your example...
Macro Name: {F5}
Action: SetValue
Item: [Screen].[ActiveControl]
Expression: "This is really confusing"

- Steve Schapel, Microsoft Access MVP
 
K

Ken Snell

Thanks, Steve......I keep forgetting about the AutoKeys...! < g >

--
Ken Snell
<MS ACCESS MVP>

Steve Schapel said:
Chris,

In addition to Ken's suggestions, you can do this with an AutoKeys
macro. Make a macro, name it AutoKeys, and if you can't see a Macro
Name column in the macro design window, enable it from the View menu.
Using your example...
Macro Name: {F5}
Action: SetValue
Item: [Screen].[ActiveControl]
Expression: "This is really confusing"

- Steve Schapel, Microsoft Access MVP


If you're working directly in the table, then a macro won't work for you.

If you're working on a form, you can create a macro that will use the
SetValue action to put the desired sentence into a control on the form
(assuming that the control is bound to the field, then it would be written
to the underlying table). You could run that macro by assigning it to a
toolbar icon that you create and add to the toolbar. But it would need to be
specifically written for a form name and a control name. Or you could create
a shortcut menu (right-click of mouse) that is associated to the desired
control on the form, and then run the macro based on that menu.

Or, you could just copy the desired sentence (Ctrl+c) and paste it into the
fields (Ctrl+v) as needed.
 

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