That ought to work. Does any VBA code work in this database? If the database isn't in a trusted location or individually trusted, code won't run.
Access 2007 Shift +F2: VBA Double Click
The database I am using has memo boxes with a substantial amount of data. I would like users to be able to double click on the memo box to zoom in and view all the data, instead of using the Shift + F2 keystroke. This is the module that was written in VBA to enable the double click feature. The Shift + F2 key works but the module does not. Is there another code that I should be using?
***Post moved by the moderator to the appropriate forum category.***
Microsoft 365 and Office | Access | For home | Windows
Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.
4 answers
Sort by: Most helpful
-
Anonymous
2017-05-26T12:19:08+00:00 -
Anonymous
2017-05-26T13:32:00+00:00 Thank you! That was the problem.
-
Anonymous
2017-05-26T16:25:21+00:00 Are you saying you moved the file to the ...\ACCWIZ folder? If so, that's not a good place for it. Instead, you should add a new trusted location, maybe your Documents folder, or whatever folder you currently have the database in.
If you have the database in a trusted folder, have exited and re-entered Access, and reopened the database, and the zoom box is still not opening, then I have to ask again if any VBA code in the database runs. If any VBA code runs, then the problem isn't a matter of trust.
Hmm, I just noticed something in your original screenshot. The window showing the code appears to be for a standard module, not a form module. If that's the case, there's no reason that code would be run when a control on your form is clicked. The code would have to be in the *form's* module!
If that's the problem -- and now I strongly suspect it is -- then you need to open the form in design view, click the "View Code" button on the ribbon to edit its class module in the VB Editor (which will create a class module for the form if it doesn't exist), and paste the code into that module. When you do that, the procedure should show (in the dropdown boxes at the top of the module window) as being associated with the DblClick event of the txtSTOCTMSLog control. If it doesn't, you may have misspelled the name of the control.
If you switch back to the design view window, click on the text box and open its property sheet, on the Event tab of the property sheet the "On Dbl Click" property should now show "[Event Procedure]".