I have a database in Access 2003 that I only want certain people to be able to access. In my database I have a table which lists the people that should be able to access the da
Try something like the below:
Function RealName()
payroll = Environ("Username")
firstname = DLookup("[first name]", "[Payroll Numbers]", "[persno] = " & payroll)
lastname = DLookup("[Last name]", "[Payroll Numbers]", "[persno] = " & payroll)
If IsNull(firstname) = True Then
RealName = payroll
Else
RealName = firstname & " " & lastname
End If
End Function
You can then enter code in the form_load event to make sure it's a verified user.