I'm trying to either enable for disable the save button on a form based on a security table.
SecCheck = DLookup("[AreaCode]", "Security_Table", "[Text57]=[AdministratorID]")
SecCheckResults = IIf([Area] = [SecCheck], True, False)
If (SecCheckResults = True) Then
SaveBtn.Enabled = True
Else
SaveBtn.Enabled = False
End If
So, the above example, I'm bringing back AreaCode based on if the Login ID(in Text57) of the user matches the AdminstratorID in the Security_Table. However, if they have multiple areas that they have security for(there ID is in the table more than once), I'm only getting the first row. Can I use DLookup then, or should I use something else?
Please help. Thanks!
SecCheck = DLookup("[AreaCode]", "Security_Table", "[Text57]=[AdministratorID]")
SecCheckResults = IIf([Area] = [SecCheck], True, False)
If (SecCheckResults = True) Then
SaveBtn.Enabled = True
Else
SaveBtn.Enabled = False
End If
So, the above example, I'm bringing back AreaCode based on if the Login ID(in Text57) of the user matches the AdminstratorID in the Security_Table. However, if they have multiple areas that they have security for(there ID is in the table more than once), I'm only getting the first row. Can I use DLookup then, or should I use something else?
Please help. Thanks!