Wappervliegje
Registered User.
- Local time
- Today, 10:43
- Joined
- Nov 11, 2014
- Messages
- 23
Dear people,
I get always "Run time error '2450': Microsoft Office Access can't find the form". I don’t know how I can to let know the Access where that subform or subsubform is finding to running the function. See below the three "difference" codes I have made to call the function from the module. Neither of them is working.
See below the function "UserSID" in the module
Please, can you help my to find a wrong?
With kindly regards,
Wappervliegje!
P.S. I hope that my bad English is good enough to understand?
I get always "Run time error '2450': Microsoft Office Access can't find the form". I don’t know how I can to let know the Access where that subform or subsubform is finding to running the function. See below the three "difference" codes I have made to call the function from the module. Neither of them is working.
Code:
Private Sub Form_Open(Cancel As Integer)
UserSID (Me.Form.Name)
End Sub
Code:
Private Sub Form_Open(Cancel As Integer)
UserSID ("Forms![" & Me.Parent.Parent.Name & "]![" & Me.Parent.Name & "].Form![" & Me.Name & "]")
End Sub
Code:
Private Sub Form_Open(Cancel As Integer)
UserSID ("Forms![frm_D_MRD]![fsub_MRD].Form![fsub_MRD_Materials_New]")
End Sub
See below the function "UserSID" in the module
Code:
Public Function UserSID(frmName As String)
Dim DLookUpSID As String
DLookUpSID = DLookup("Security_ID", "tbl_Security_Level", "[Security_ID]=" & _
Nz(DLookup("User_Security_ID", "tbl_User", "[User_Name]='" & Environ("USERNAME") & "'"), "5") & "")
Select Case DLookUpSID
Case 1
With Forms(frmName)
.AllowEdits = False
.AllowDeletions = False
.AllowAdditions = False
End With
Case 2
With Forms(frmName)
.AllowEdits = False
.AllowDeletions = False
.AllowAdditions = False
End With
Case 3
With Forms(frmName)
.AllowEdits = False
.AllowDeletions = False
.AllowAdditions = False
End With
Case 4
With Forms(frmName)
.AllowEdits = False
.AllowDeletions = False
.AllowAdditions = False
End With
Case 5
With Forms(frmName)
.AllowEdits = False
.AllowDeletions = False
.AllowAdditions = False
End With
End Select
End Function
Please, can you help my to find a wrong?
With kindly regards,
Wappervliegje!
P.S. I hope that my bad English is good enough to understand?