This topic is kind of related to this one: https://www.accessforums.net/showthread.php?t=77041. Because I am using the same basic code and Idea, mainly this:
Code:
Dim strCheck As String
strCheck = getValuefromTable("SELECT ROL FROM ADMIN_ROLLEN WHERE GEBRUIKER = '" & Environ("USERNAME") & "'")
If Environ("USERDOMAIN") = "XXXX" And strCheck = "Admin" Then
Else
If Environ("USERDOMAIN") = "XXXX" And strCheck = "BIB" Then
Else
End If
End If
Now I know there is another possible solution by islagdogs, to set up controls to make it easier, I am just using that code as base. And I want to use his solution another day.
isladogs.
Here is the Deal: I want to set some Certain Filter Checks that make sure the Doc Manager Database searches into certain folders. However there will be certain Group of Users Called BIB who only need to search in the Library and not inside the network. So for those users it would be best those Filter Checks have the default value of 0. These Filters are part of a Sub Forum where the Column Name is Filter Check and the Field Name is Filter Check2.
Now I have written this in code:
Code:
Private Sub Form_Load()
Dim strCheck As String
strCheck = getValuefromTable("SELECT ROL FROM ADMIN_ROLLEN WHERE GEBRUIKER = '" & Environ("USERNAME") & "'")
If Environ("USERDOMAIN") = "XXXX" And strCheck = "Admin" Then
FILTER_CHECK2 = True
Else
If Environ("USERDOMAIN") = "XXXX" And strCheck = "BIB" Then
FILTER_CHECK2 = False
Else
FILTER_CHECK2 = False
End If
End If
End Sub
And so far it seems to work but with one Problem: The code only disables one of the four Filter Checks.
Any reason why this is Happening? I know the Subform pulls from and Selects from Querry as source and each Filter Check has his own ID but that should not be the issue.