View Full Version : Hello folks...keyboard shortcuts


q2q2
11-13-2006, 02:15 PM
Hello to everyone on this site. I am a new member and i am concerning myself with access2003 and VBA. But i have a problem with macros. As the matter of fact the issue is the following:
is there any possile way to give the macro name (in autokeys macro) which will begin with the keyboard button: ALT. Or i would like to ask u how to disable the buttons:ALT+ENTER and consequently stop the user from using Properties( ALT + ENTER gives properties of the object).
Thank u very much
Vlado from Macedonia

PeterF
11-14-2006, 04:42 AM
There's no way to create a macro with the alt key, you could use the KeyDown event to trap this in a form to block the alt-enter or create your own shortcut.
The easiest way to stop the user viewing/editing the properties of a object on a form is to set the "Allow design changes" property of the form to "only in design mode".

The code below will do this for all forms in your database.


Public Function AllFormsDesignViewOnly()
Dim doc As DAO.Document
Dim db As DAO.Database

On Error Resume Next
Set db = CurrentDb
DoCmd.Hourglass True
Echo False

For Each doc In db.Containers("Forms").Documents
DoCmd.OpenForm doc.Name, acDesign
Forms(doc.Name).AllowDesignChanges = False
DoCmd.Close acForm, doc.Name, acSaveYes
Next

MsgBox "Disabled AllowDesignChanges for all forms when not in edit mode!!", vbInformation + vbMsgBoxSetForeground

Set db = Nothing
Echo True
DoCmd.Hourglass False

End Function