Question

I am using Microsoft Access 2010 and I was just curios to know if I can set up my own short cut keys to fill lines of code out for me.

For example if I did: Hold Ctrl and pressed 1 it would print out the line of code: Debug.Print "This is creating a line of code from a shortcut key"

Is this possible to do in VBA?

Was it helpful?

Solution

I use MZ-tools in my VBA IDE. It allows this kind of functionality (along with a lot of other cool things)

When you get it installed you will want to create a Code Template. Go to

Tools > MZ-Tools > Options > Code Templates

Add... a new template like so: MA-tools code template

OK > OK

No in your IDE press Ctrl+1 and out pops

Debug.Print "This is creating a line of code from a shortcut key"

You can use variables in this template too if you want to get fancy.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top