用于执行代码的键盘快捷键? [英] Keyboard Shortcuts to Execute Code?

查看:115
本文介绍了用于执行代码的键盘快捷键?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嘿朋友,


MS Access 2010.


有没有人知道一种执行代码(甚至宏)的方法使用键盘快捷键?例如,如果我有一个代码块(或宏)要检查新的数据更新(或任何 - 这只是一个例子),但我希望能够从任何地方执行它在一个项目中(并且在任何时候)只需点击,例如, Ctrl-Shift-Q


我''我只是在探索新的想法和可能性,而这一点可能会对我想做的事情非常有用。


感谢你所有的hepp!

解决方案

我不知道如何设置这样的程序级键盘快捷键,但您可以使用每个表单上的KeyUp事件来调用您的代码。只需将表单的'Key Preview属性设置为Yes并测试键代码组合。

< span class =codeLinkonclick =Blur(this,this.parentNode.parentNode,getChildren(this),true);>展开 | 选择 | Wrap | 行号


这假定表格是开放的并且具有焦点。这似乎是一个潜在的选择。我正在寻找任何时候打开数据库,没有打开任何表格(即,如果后端打开),这样我就可以运行代码来取消导航窗格并覆盖ByPass密钥,但是,仍然是允许使用快捷键将其反转。


Hmmmmmmmmmmmmm ..


谢谢,塞思!


< blockquote>我刚刚发现了如何。创建一个名为AutoKeys的宏。给它一个submacro,其中submacro的名称是你的组合键(^表示Ctrl,+表示Shift),并且可以根据需要执行操作。如果你想谷歌它,这称为AutoKeys。我让它与Ctrl + Q一起使用,但我无法使用Ctrl + Shift + Q工作。你可能不得不玩。


Hey Friends,

MS Access 2010.

Does anyone know of a way to execute Code (or even a Macro) by using a Keyboard Shortcut? For example, if I have a block of Code (or a Macro) that were to check for new data updates (or ANYTHING--that is just a "fer example"), but I wanted to be able to execute it from anywhere within a Project (and at any time) by simply hitting, for example, Ctrl-Shift-Q.

I''m just exploring new ideas and possibilities, and this one came to mind as potentially being very useful for what I want to do.

Thank for all your hepp!

解决方案

I don''t know of a way to set a program level keyboard shortcut like that, but you can use the KeyUp event on each form to call your code. Just set the form''s Key Preview property to Yes and test for the key code combination.

Expand|Select|Wrap|Line Numbers


This assumes a Form is open and with the focus. It seems like a potential option. I''m looking for anytime the DB is opened, with no forms being open (i.e., if the Back End is opened), such that I could run code to take away Navigation Pane and override the ByPass Key, but, then still be allowed to reverse it, all using shortcut keys.

Hmmmmmmmmmmmmm..

Thanks, Seth!


I just found out how. Create a macro called AutoKeys. Give it a submacro with the name of the submacro being your key combination (^ for Ctrl, + for Shift) and have its action be whatever you need. This is called AutoKeys if you want to google it. I got it to work with Ctrl + Q, but I couldn''t get Ctrl + Shift + Q to work. You may have to play with that.


这篇关于用于执行代码的键盘快捷键?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆