Hello,
I need help Programming some new code into a existing Access Database that also has Visual Basic Code. This Access Database contains many documents that are either hyperlinked or not and even have a form based article records (because they are from a library) if they have one.
Now this Database will also be used for a terminal in the Library, aka a "Special Quest Account" under the network to search for Library Documents. So the Form needs to be in a certain "Default state" where some Checkmarks have the Default value of 1 and other 0. The Screenshot below "Default State" shows which checkmarks and Filters need to be ".Enabled= True" and ".Enabled= False" at default, when that specific user has logged in.
Not only that but as an extra I would like certain "chk" and "txt" elements to be invisible on that form. The Screenshot below illustrate this:
Now as for coding so far this is the only that seems to be relevant to do this because it does the following:
Code:
Private Sub Form_Load()
Dim strCheck As String
DoCmd.Maximize
lblUser.Caption = "Ingelogd als : " & Environ("USERDOMAIN") & "\" & Environ("USERNAME")
strCheck = getValuefromTable("SELECT ROL FROM ADMIN_ROLLEN WHERE GEBRUIKER = '" & Environ("USERNAME") & "'")
If Environ("USERDOMAIN") = XXX" And strCheck = "Admin" Then
btnAdmin.Enabled = True
btnBIB.Enabled = True
Else
If Environ("USERDOMAIN") = XXX" And strCheck = "BIB" Then
btnAdmin.Enabled = False
btnBIB.Enabled = True
Else
btnAdmin.Enabled = False
btnBIB.Enabled = False
End If
End If
writeLog "LOGON", lblUser.Caption
CurrentDb.Execute "UPDATE ADMIN_FOLDERS SET FILTER_CHECK2 = True", dbFailOnError
The code that is Highlighted in Bold is the part where the code I think should been written. But in fact what we have here are Three Forms. The Code above is MAIN_FRM while the Actual Ellements are on the FRM Documents. So how to do this?