Is it possible to attach a sub or function to a set of Key Strokes (Ctrl d for example)? I have a sub that inserts today’s date into controls on double-clicking and I thought it would be useful to be able to use key combinations too.
Peter
![]() |
Patch reliability is unclear. Unless you have an immediate, pressing need to install a specific patch, don't do it. |
SIGN IN | Not a member? | REGISTER | PLUS MEMBERSHIP |
-
Key Strokes and Functions (Access 2k sr1)
Home » Forums » AskWoody support » Productivity software by function » MS Access and database help » Key Strokes and Functions (Access 2k sr1)
- This topic has 4 replies, 4 voices, and was last updated 22 years, 5 months ago.
AuthorTopicWSherworth
AskWoody LoungerNovember 7, 2002 at 5:29 pm #379090Viewing 1 reply threadAuthorReplies-
WSSteveH
AskWoody Lounger -
WBell
AskWoody_MVPNovember 7, 2002 at 6:03 pm #629985 -
WSherworth
AskWoody LoungerNovember 7, 2002 at 6:43 pm #630015Steve and Wendell
Thanks for the quick reponse. I know quite a few kb shortcuts but not that one (how embarrassing). Still that was a minor part of the question. I’ve tried various actions to work a kb shortcut using Keyup, keydown etc but I can’t seem to get it absolutely right. I’ve been able to get it from one key but not a combination which of course is what’s required.
Peter -
WScarbonnb
AskWoody LoungerNovember 7, 2002 at 7:35 pm #630046Peter,
Here is how I would capture a Ctrl+D in a textbox.
Private Sub Text0_KeyDown(KeyCode As Integer, Shift As Integer) Dim CtrlDown As Boolean 'Determine if the Ctrl key was pressed CtrlDown = (Shift And acCtrlMask) > 0 'Check to see if CTRL+D was pressed If CtrlDown = True And KeyCode = vbKeyD Then 'Insert the current Date into the textbox Text0.Text = Date End If End Sub
This is the KeyDown event of the particular textbox.
You can also capture this at the form level, by placing the text into the KeyDown event of the form AND setting the Key Preview setting to Yes.
-
-
Viewing 1 reply thread -

Plus Membership
Donations from Plus members keep this site going. You can identify the people who support AskWoody by the Plus badge on their avatars.
AskWoody Plus members not only get access to all of the contents of this site -- including Susan Bradley's frequently updated Patch Watch listing -- they also receive weekly AskWoody Plus Newsletters (formerly Windows Secrets Newsletter) and AskWoody Plus Alerts, emails when there are important breaking developments.
Get Plus!
Welcome to our unique respite from the madness.
It's easy to post questions about Windows 11, Windows 10, Win8.1, Win7, Surface, Office, or browse through our Forums. Post anonymously or register for greater privileges. Keep it civil, please: Decorous Lounge rules strictly enforced. Questions? Contact Customer Support.
Search Newsletters
Search Forums
View the Forum
Search for Topics
Recent Topics
-
It’s Identity Theft Day!
by
Susan Bradley
10 minutes ago -
Android 15 require minimum 32GB of storage
by
Alex5723
2 hours, 57 minutes ago -
Mac Mini 2018, iPhone 6s 2015 Are Now Vintage
by
Alex5723
3 hours, 6 minutes ago -
Hertz says hackers stole customer credit card and driver’s license data
by
Alex5723
3 hours, 37 minutes ago -
advice for setting up a new windows computer (Awaiting moderation)
by
routtco1001
3 hours, 58 minutes ago -
Firefox became sluggish
by
Rick Corbett
31 minutes ago -
Windows 10 Build 19045.5794 (22H2) to Release Preview Channel
by
joep517
7 hours, 35 minutes ago -
Windows 11 Insider Preview Build 22635.5235 (23H2) released to BETA
by
joep517
8 hours, 4 minutes ago -
A Funny Thing Happened on the Way to the Forum
by
bbearren
3 hours, 35 minutes ago -
Download speeds only 0.3Mbps after 24H2 upgrade on WiFi and Ethernet
by
John
4 hours, 58 minutes ago -
T-Mobile 5G Wireless Internet
by
WSmmi16
9 hours, 59 minutes ago -
Clock missing above calendar in Windows 10
by
WSCape Sand
1 hour, 8 minutes ago -
Formula to Calculate Q1, Q2, Q3, or Q4 of the Year?
by
WSJon5
22 hours, 50 minutes ago -
The time has come for AI-generated art
by
Catherine Barrett
2 hours, 53 minutes ago -
Hackers are using two-factor authentication to infect you
by
B. Livingston
12 hours, 34 minutes ago -
23 and you
by
Max Stul Oppenheimer
19 hours, 48 minutes ago -
April’s deluge of patches
by
Susan Bradley
1 hour, 8 minutes ago -
Windows 11 Windows Updater question
by
Tex265
11 minutes ago -
Key, Key, my kingdom for a Key!
by
RetiredGeek
2 days, 4 hours ago -
Registry Patches for Windows 10
by
Drcard:))
2 days, 9 hours ago -
Cannot get line length to NOT wrap in Outlining in Word 365
by
CWBillow
1 day, 15 hours ago -
DDU (Display Driver Uninstaller) updates
by
Alex5723
1 day, 1 hour ago -
Align objects on a OneNote page
by
CWBillow
2 days, 14 hours ago -
OneNote Send To button?
by
CWBillow
2 days, 15 hours ago -
WU help needed with “Some settings are managed by your organization”
by
Peobody
2 days, 23 hours ago -
No Newsletters since 27 January
by
rog7
1 day, 4 hours ago -
Linux Mint Debian Edition 7 gets OEM support, death of Ubuntu-based Mint ?
by
Alex5723
2 days ago -
Windows Update “Areca Technology Corporation – System – 6.20.0.41”
by
Bruce
1 day, 23 hours ago -
Google One Storage Questions
by
LHiggins
1 day, 7 hours ago -
Button Missing for Automatic Apps Updates
by
pmcjr6142
1 day, 14 hours ago
Recent blog posts
Key Links
Want to Advertise in the free newsletter? How about a gift subscription in honor of a birthday? Send an email to sb@askwoody.com to ask how.
Mastodon profile for DefConPatch
Mastodon profile for AskWoody
Home • About • FAQ • Posts & Privacy • Forums • My Account
Register • Free Newsletter • Plus Membership • Gift Certificates • MS-DEFCON Alerts
Copyright ©2004-2025 by AskWoody Tech LLC. All Rights Reserved.