Question

Is there a keyboard shortcut in Access 2003 that will run a query while in design or sql mode?

Was it helpful?

Solution

It's not built-in. I would try a macro - AutoKeys? You should be able to make almost any keyboard short you want that way.

OTHER TIPS

Sendkeys is always a mistake because almost nothing in Access not doable via code.

The correct code is:

DoCmd.RunCommand acCmdRun 

How you run that code is up to you, but it's definitely preferable to SendKeys.

I used a combination of the answers writing a little function that is called from the AutoKeys macro like so:

Public Function RunMyQuery() As Boolean
   SendKeys "%Q" & "R"
   RunMyQuery = True
End Function

Thanks!

Ctrl+, and Ctrl+. will let MS Access cycle left and right through the query views Design, Datasheet, SQL, PivotTable, PivotChart.

Otherwise, you can right click on the "Run" exclamation mark and select customize, then with that customize window open, you can right click on the "Run" exclamation mark again, select "Image and Text" to show the word Run. As long as the word is shown, you can use Alt+Shift+R to activate that button based on the underlined capital R. If you right click on the "Run" exclamation mark again and select properties, you can change the capital R to a lowercase r so that the SHIFT key isn't needed and the shortcut simply becomes Alt+R.

This function isn't built in, but you can set it up so you can press the F5 function key to run the query.

  1. Create a new macro.
  2. Use the menu, View > Macro Names to add the "Macro Names" column to the grid if it's not already showing.
  3. Type this in the "Macro Names" column: {F5}
  4. In the "Action" column, scroll down and select "RunCommand."
  5. The bottom half of the window pane is "Action Arguments." For "Command," scroll down and select "Run."
  6. Save the macro as AutoKeys.
  7. Close the macro.
  8. Open a saved query in design view or sql view.
  9. Press the function key, F5, to run the query.

Keyboard shortcut to run a query:

Press (don't hold down) Alt then tap v then tap s

Keyboard shortcut to return to query view:

Press Alt then tap v then tap q

Does Alt Q Alt R (ie menu item selection) not suit?

Not sure what resemblance this bears to the same issue in Windows 2007 but FWIW, I fixed it there by doing the following:

  1. Right click the Run button
  2. Select "Customize Quick Access Toolbar"
  3. In the dialog that appears, select "Query Tools | Design Tab" from the drop-down list on the left. The options in the list box on the left will change to reflect the selection.
  4. In the list box on the left, select "Run" and click "Add >>". "Run" should be added to the list on the right.
  5. Click Okay.

Now you can run your SQL using Alt+4.

Though not a keyboard shortcut, it is also possible to add the button to the quick Access toolbar for easy access regardless what tab you are own, or when the ribbon is minimized.

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