- Local time
- Today, 15:25
- Joined
- Feb 28, 2001
- Messages
- 30,090
Ac 2003 involved here.
I am building my own styles wizard to include populating customized event code to do auditing, change control attributes based on focus changes, do security checks on who is running and allowed to run, etc.. I also customize the appearance of the controls as a "uniformity of experience - look and feel" issue. I'm finding problems in populating event code on an arbitrary form.
I tried to empty out the module and remove it manually (which you do by setting the form.hasmodule=FALSE), then tried to regenerate the module from scratch. I first opened the module with a docmd acModule operation, but it comes up in interactive design mode. My code freezes and I don't get to execute the next line. It wants me to close the code manuallly, but won't execute command that would do that programmatically. Next thing I tried is to just define a module variable with the
SET MODULEVARIABLE = FORMVARIABLE.MODULE
construct. Then used various syntaxes to try to insert a line. (Yeah, obviously including .INSERTLINES, which I wanted to insert one line at a time and I was tracking line numbers myself.) But it told me that the module wasn't open or didn't exist. I researched that, manually went back to set the .HASMODULE property to TRUE. Repeated the above. No joy. (Even though I can now see the "empty" module that has the Option Compare Database and Option Explicit statements that are consistent with my defaults from the DB Options menu.
Once the module exists and has anything else in it, I have less trouble. But as it sits right now, I cannot make it build event routines or insert declarations from scratch. I've looked at the examples. For a while it was working, but now it is balking me. Has anyone seen this kind of problem before and if so, what did you do?
I am building my own styles wizard to include populating customized event code to do auditing, change control attributes based on focus changes, do security checks on who is running and allowed to run, etc.. I also customize the appearance of the controls as a "uniformity of experience - look and feel" issue. I'm finding problems in populating event code on an arbitrary form.
I tried to empty out the module and remove it manually (which you do by setting the form.hasmodule=FALSE), then tried to regenerate the module from scratch. I first opened the module with a docmd acModule operation, but it comes up in interactive design mode. My code freezes and I don't get to execute the next line. It wants me to close the code manuallly, but won't execute command that would do that programmatically. Next thing I tried is to just define a module variable with the
SET MODULEVARIABLE = FORMVARIABLE.MODULE
construct. Then used various syntaxes to try to insert a line. (Yeah, obviously including .INSERTLINES, which I wanted to insert one line at a time and I was tracking line numbers myself.) But it told me that the module wasn't open or didn't exist. I researched that, manually went back to set the .HASMODULE property to TRUE. Repeated the above. No joy. (Even though I can now see the "empty" module that has the Option Compare Database and Option Explicit statements that are consistent with my defaults from the DB Options menu.
Once the module exists and has anything else in it, I have less trouble. But as it sits right now, I cannot make it build event routines or insert declarations from scratch. I've looked at the examples. For a while it was working, but now it is balking me. Has anyone seen this kind of problem before and if so, what did you do?