• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 427
  • Last Modified:

How to launch visual basic in access with hotkey?

I'm trying to put in a back door to get into visual basic from a form in access. On the forms KeyDown event I want to put in code to say when Ctrl+Shift+Q is pressed it will launch Visual Basic, which is also password protected. Any idea if that can be done?

Thanks for the help!
Jarred Meyer
Jarred Meyer
2 Solutions
I'm not sure about applying the password programatically, but this will open the VB Editor:

VBE.MainWindow.Visible = True
Jarred MeyerProduction ManagerAuthor Commented:
Any Idea on the hotkey setup?

I tried the following and couldn't get the VBE to come up;

Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)

     'checks to see if m is capitalized
    If KeyCode = vbKeyM And Shift = 1 Then
        VBE.MainWindow.Visible = True
    End If

End Sub

Ultimately I would like to use Ctrl+Shift+Q to open it.. Just don't know that code quite yet. Found this code above on another page.
Rey Obrero (Capricorn1)Commented:
are you trying to modify codes while the form is in "Form" view?
i suggest not to, because this might lead to form corruption.

while form in design view, just hit  Alt + F11
Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

Jarred MeyerProduction ManagerAuthor Commented:
Actually trying to create a backdoor to a module that prevents the database from being opened in Shift mode. I have to be able to get to that module to enable shift mode so that I can get back into design view for the database.

Here is a link where I started this process;

Just use a commandbutton, hidden, disguised, or password protected to run that function to toggle that property.
Some of our applications here have tiny password protected labels that blend in with the background of the form that the dba's use to bring up an 'admin' form, which has enable/disable shift key bypass buttons and other things.

It's not 100% secure of course, but it is okay for our environment.
Jarred MeyerProduction ManagerAuthor Commented:
That will work!
Jeffrey CoachmanMIS LiasonCommented:

My guess is what mbizup posted is the most straightforward technique...

Just as an FYI, You can create an AutoKeys Macro that open the VBE using a hot key.

See this sample...
Open the DB, and at any point if you press Ctrl+Shift+Q, the VBE will open.
Jarred MeyerProduction ManagerAuthor Commented:
Thanks Boag. Also a good method!
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Amazon Web Services - Basic

Are you thinking about creating an Amazon Web Services account for your business? Not sure where to start? In this course you’ll get an overview of the history of AWS and take a tour of their user interface.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now