Can't perform operation since the project is protected.

Core

Registered User.
Local time
Today, 11:06
Joined
May 27, 2008
Messages
79
Hello,

When I make a database I have done into an MDE one of the forms no longer works and gives the error "Can't perform operation since the project is protected."

Here is the code behind the control (a button) that does not work. Any idea's why? It works fine before protecting the form:

Code:
Private Sub Command36_Click()
On Error GoTo Err_Command36_Click

    If Test_Date <> "" And Test_Version <> "" And Module <> "" And Test_Score <> "" And Invigilator <> "" Then
        If Check32 = False Then AnswerE = MsgBox("You have not idicated if evidence of this test is in the file, please check with the tutor if there is no evidence of this test", vbInformation, "Warning")
        'If Me.Dirty Then Me.Dirty = False
        Me.ID = OpenArgs
        DoCmd.Close
    Else
        AnswerA = MsgBox("You have not completed all of the required fields, please check. If unsure please confirm with the tutor.", vbExclamation, "Cannot Enter Test")
    End If

Exit_Command36_Click:
    Exit Sub

Err_Command36_Click:
    MsgBox Err.Description
    Resume Exit_Command36_Click
    
End Sub

Kind Regards,
 
Code:
    If Test_Date <> "" And Test_Version <> "" And Module <> "" And Test_Score <> "" And Invigilator <> "" Then
        If Check32 = False Then AnswerE = MsgBox("You have not idicated if evidence of this test is in the file, please check with the tutor if there is no evidence of this test", vbInformation, "Warning")
        'If Me.Dirty Then Me.Dirty = False
        Me.ID = OpenArgs
        DoCmd.Close
    Else
        AnswerA = MsgBox("You have not completed all of the required fields, please check. If unsure please confirm with the tutor.", vbExclamation, "Cannot Enter Test")
    End If

Cosmetic:
Spelling error in message (idicated)


Posible naming conflict:

And Module <> ""

Module is an Access reserved word

Logic:
What is contained in OpenArgs, and do you actully need it as you are cling the form anyway.

Readability:
When using If Then best to use

Code:
If ... Then
  ....
Else
  ....
End If

Which part of the code is causing the error?

David
 
Hello David,

It seems it was the Module name conflict, works fine now :D

Many thanks!
 

Users who are viewing this thread

Back
Top Bottom