Hello folks...keyboard shortcuts (1 Viewer)

q2q2

New member
Local time
Today, 08:57
Joined
Nov 13, 2006
Messages
1
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

Registered User.
Local time
Today, 17:57
Joined
Jun 6, 2006
Messages
295
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.


Code:
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
 

Users who are viewing this thread

Top Bottom