Thanks NeoPa for your suggestion, but prefixing the form name with "Form" isn't necessary for me because I always start my form names with "frm".
Thanks MTB. KIS principal wins again :) I don't even recall how I ended up with Me.Module.Name originally (copy and paste I expect).
As you might have guessed, I am fairly new to VBA programming, so please excuse me if I ask dumb questions in the future...
User Profile
Collapse
-
Now it makes total sense regarding the modules.
I've defined a constant for each form and it works fine now (less lines of code than before).
Thanks very much for your quick advice.Leave a comment:
-
I've found the offending line of code:
It seems that Me.Module.Name works fine in accdb, but not in accde format. I have no idea why it should be different (but it would be nice to find out).Code:strModName = Me.Module.Name
I need to know the module name so that I can include it in my error table.
As a work-around, I can manually type in the module name for every sub, but if anyone knows another way to programmaticall y...Leave a comment:
-
After a lot of good old "trial and error", I've nailed the problem down to the error code (if I delete the error code lines, it works OK).
I will try to limit it down further, then post another message.
The thing that is really concerning me is: why does it work in accdb format, but not in accde format?Leave a comment:
-
Sorry about that. Here is the code.
...Code:Private Sub UserName_DblClick(Cancel As Integer) 'On Error GoTo Err_Handler Dim strModName As String strModName = Me.Module.Name If (Form.Dirty) Then DoCmd.RunCommand acCmdSaveRecord End If 'Opening Argument at end of following command is used to show/hide some buttons on details form DoCmd.OpenFormLeave a comment:
-
Errors with VBA Code in Class Objects in accde database
Hi, this is my first post here, so I hope I'm doing it right.
After converting an Access 2007 accdb database to accde, the vba code in my modules runs OK, but the code in my class objects (forms) wont run. In these cases, I always get the error message "The expression On Dbl Click you entered as the event property setting produced the following error: Can't perform operation since the project is protected" (or something similar...
No activity results to display
Show More
Leave a comment: