I can't seem to create an AutoKeys macro in MS ACCESS 2010. IS it possible and if so a clearway to create an Autokeys macro.
I can't seem to create an AutoKeys macro in MS ACCESS 2010. IS it possible and if so a clearway to create an Autokeys macro.
I have an autokeys macro. It was created with Access 2007 but still works fine.
Exactly what is the issue you encounter? What happens - error message, wrong results, nothing?
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
Thanks for the quick response but I haven't been able to create an AutoKeys macro in MS Access 2010. My question was "Can you create an AutoKeys macro in MS Access 2010 and if so, How?" Any helpwould be appreciated.
Just tested.
1. Open macro design
2. Click Submacro from Action Catalog
3. Entered ^p into Submacro name box
4. Selected MessageBox action - message "Ctrl+p disabled"
5. Saved macro named AutoKeys - I got error message but the macro did save, however, the ^p Submacro name was not saved. I reopened macro in design, entered the ^p and saved again. This time no error.
Macro works.
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
I triedto create the macro as stated and it created a macro named AutoKeys. In place of ^p I used the string F1 and later tried {F1} the macro gave an error but it didn't trap the F1 key, Any help would be appreciated.Just tested.
1. Open macro design
2. Click Submacro from Action Catalog
3. Entered ^p into Submacro name box
4. Selected MessageBox action - message "Ctrl+p disabled"
5. Saved macro named AutoKeys - I got error message but the macro did save, however, the ^p Submacro name was not saved. I reopened macro in design, entered the ^p and saved again. This time no error.
Macro works.
I've never tried to trap function keys. But should work according to https://support.office.com/en-us/art...B-A3C81AF676BE
Which I just tested by replacing ^p with {F1} - it works.
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
I must be doing something wrong. I created a Macro and named it AutoKeys. I inserted a submaco and named it {F1} using braces as required IAW the Help file. I then added a Messagebox command which displays "F1 key pressed" and then I added a RunCode command with "ShowF1help()". the function SHowF1Help returns True or false and has no parameters. The error I get is "MS Access can't find the fucntion listed"I've never tried to trap function keys. But should work according to https://support.office.com/en-us/art...B-A3C81AF676BE
Which I just tested by replacing ^p with {F1} - it works.
When I run the Autokeys macro it displays the Messagebox string correctly but then can't find the SHowF1Help function. The MS Help dialog box is displayed instead of the PDF file SHowF1Help would show. I must be doing something different. I am using MS Access 2010 in Windows 7 Professional. Any help would be appreciated. I am able to successfully run the ShowF1help function on a test form using a command button Click event.Code:'--------------------------------------------------------------------------------------- ' Procedure : ShowF1Help ' Author : Admin ' Date : 4/9/2015 ' Purpose : ' 'Parameters: 'Return: 'Changed:Ck#1 'Functions Used:CT#1 '--------------------------------------------------------------------------------------- Public Function ShowF1Help() As Boolean On Error GoTo ErrorHandler Const CALLER As String = " Form_frmCommittee:ShowF1Help " Dim tHelp As tHelpConstants Dim strpath As String Dim strMain As String Dim bResult As Boolean strMain = Me.Name 'tHelp.gstrFName = GetHelpFile(strMain) 'gets the new RTF file Name Debug.Print Me.Name 'OK got it 'tHelp = SetUpHelp(frmMain) ''get name if Help ODF file created and stored in M_DocDir & "\Help PDF Files\" directory strpath = M_DocDir & "\Help PDF Files\" & tHelp.gstrFName 'new Display the PDF file strpath displaying help for the current form OpenPDF (strpath) bResult = True Cleanup: ShowF1Help = bResult Exit Function ErrorHandler: MsgBox Err.Description & vbCrLf & _ Err.Number & vbCrLf & _ "Called By :" & CALLER & vbCrLf & _ Err.Source, VbMsgBoxStyle.vbCritical, "Could not add new name to data base" & vbCrLf & _ "Module Name: = " & MODULENAME bResult = False GoTo Cleanup End Function
Is that function in a general code module?
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
That is correct. A code module not associated with a form or report.
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
I moved the function to a separate Code module and now the function is accepted in the MAcro Runcode command. However the Auokeys macro does not run when the F1 key is pressed in the application. The MS Office help dialog box appears. But I remember something about KeyPreview?? I'll ck that property. Thanks for your Help I really appreciate it. '
I can't seem to find the referenceto the Key Preview property. Any ideas? Is it in the Form properties? Still can't get the application to respond to my "F1" keypress. The macro is error free but the AutoKeys part is ignored.
Odd. I have no problem executing the macro when F1 is pressed. MessageBox and function both run.
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
Thanks for all your help. I can run the Autokeys macro with no errors and it displays a PDF document with the specific help for the active form or control. It works but I can't get the "Windows Help and Suipport " dialog box from appearing even though there is a Keycode= 0 in the forms Keydown event. My Help screen appears simultaneously and I just press the Close icon for the Windows dialog box. I must have a very peculiar system since no one else is having this problem. I can live with what the situation but my curiosity is killing me since I can't find a real answer to the problem. Once again thanks for all the effort. Does any one else get this "Windows Help and Support" dialog box when F1 key pressed. I will try a Shift F1 to see if I can work around this conundrum.
I do not get the Help window. Not using KeyDown event. Tested on two computers. Cannot replicate issue.
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.