I have developed a login module and one of the functions of it is to iterate through all forms changing the
This works well for the latter half of the process which is locking them all down, but for some reason I have a logic error in setting the property value to true. Thoughts?
I have already tried debugging inside of the For loop and it iterates through each form in the Admin/Design Case, it just doesn't seem to change the property value to true...
Forms(obj.Name) .ShortcutMenu property to true or false depending on the access level. This works well for the latter half of the process which is locking them all down, but for some reason I have a logic error in setting the property value to true. Thoughts?
I have already tried debugging inside of the For loop and it iterates through each form in the Admin/Design Case, it just doesn't seem to change the property value to true...
Code:
Public Function UpdateForms()
'On Error Resume Next
Dim obj As AccessObject, dbs As Object
Set dbs = Application.CurrentProject
Select Case strGlobalAccess
Case "Administrator", "Design"
'Search for open AccessObject objects in AllForms collection.
For Each obj In dbs.AllForms
If obj.Name <> "frmBackground" Then
DoCmd.OpenForm obj.Name, acDesign, , , , acHidden
Forms(obj.Name).ShortcutMenu = True
DoCmd.Close acForm, obj.Name, acSaveYes
End If
Next obj
DoCmd.OpenForm strHomePage
Exit Function
Case Else
'Search for open AccessObject objects in AllForms collection.
For Each obj In dbs.AllForms
If obj.Name <> "frmBackground" Then
DoCmd.OpenForm obj.Name, acDesign, , , , acHidden
Forms(obj.Name).ShortcutMenu = False
DoCmd.Close acForm, obj.Name, acSaveYes
End If
Next obj
Exit Function
End Select
End Function
Comment