Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
If Len(DLookup("User", "TableName" "User = '" & UserName & "'")) = 0 then
Me.AllowAdditions = False
Me.AllowDeletions = False
Me.AllowEdits = False
Else
Me.AllowAdditions = True
Me.AllowDeletions = True
Me.AllowEdits = True
End If
Public Sub MakeFormReadOnly(frmForm As Form)
With frmForm
If Len(DLookup("User", "TableName" "User = '" & UserName & "'")) = 0 then
.AllowAdditions = False
.AllowDeletions = False
.AllowEdits = False
Else
.AllowAdditions = True
.AllowDeletions = True
.AllowEdits = True
End If
End With
End Sub
Call MakeFormReadOnly(Me)
Private Sub Form_Current()
Call MakeFormReadOnly(Me)
End Sub
blnIsAdminUser = Len(DLookup("UserID", "AuthorizedUsers", "UserID = '" & User & "'"))
DoCmd.Maximize
Dim blnIsAdminUser As Boolean
Dim cntr As Control
'MsgBox User
blnIsAdminUser = Len(DLookup("UserID", "MetUsers", "UserID = '" & User & "'"))
'MsgBox "The variable is" & " " & blnIsAdminUser
'MsgBox blnIsAdminUser
For Each cntr In Me.Controls
If cntr.Tag = "ADMIN_CNTR" Then
cntr.Visible = blnIsAdminUser
End If
Next cntr
blnIsAdminUser = Len(Nz(DLookup("UserID", "AuthorizedUsers", "UserID = '" & User & "'")))