Hello Gimmieknowledge,
So, I took a look at the sample files for this chapter (which you can download from here:
http://www.wrox.com/WileyCDA/WroxTit...-DOWNLOAD.html), and I think I can help fix your problem here. It looks like the "KEY_ALL_ACCESS" constant that is used in the code you provided is defined in the "basRegistryFunctions" module of the "RegistrySamples.accdb" database file in the Chapter 10 sample code. I think you should be able to add the following line of code to the top of your VBA module where you use the "RegOpenKeyEx" function. The code should be:
Code:
Private Const KEY_ALL_ACCESS As Long = (( _
STANDARD_RIGHTS_ALL _
Or KEY_QUERY_VALUE _
Or KEY_SET_VALUE _
Or KEY_CREATE_SUB_KEY _
Or KEY_ENUMERATE_SUB_KEYS _
Or KEY_NOTIFY _
Or KEY_CREATE_LINK) _
And (Not SYNCHRONIZE))
Anyway, I hope that helps, but if you need anymore help on this, please just let me know and I'll do what I can to help. And thanks again for reading the Access 2010 Programmer's Reference!
Best Regards,