Looking at this code. Is there a better way of doing this?
Function SET_Current_User(ByVal STR_User As String) As String
Dim STR_SQL As String
Dim DB As DAO.Database
Dim RS As DAO.Recordset
STR_SQL = "SELECT TBL_Employee_Info.EMP_First_Name, TBL_Employee_Info.EMP_Last_Name, TBL_Employee_Info.EMP_ID_Number, TBL_Employee_Info.EMP_User_Name, " & _
"TBL_Employee_Info.EMP_User_Level FROM TBL_Employee_Info WHERE TBL_Employee_Info.EMP_User_Name = '" & STR_User & "';"
Set DB = CurrentDb()
Set RS = DB.OpenRecordset(STR_SQL, dbOpenSnapshot, dbReadOnly)
If Not RS.BOF Then
If RS(0) <> "" Then Current_User_First_Name = RS(0)
If RS(1) <> "" Then Current_User_Last_Name = RS(1)
If RS(2) <> "" Then Current_User_Number = RS(2)
If RS(3) <> "" Then Current_User_Name = RS(3)
If RS(4) <> "" Then Current_User_Level = RS(4)
End If
RS.Close
Set RS = Nothing
DB.Close
Set DB = Nothing
End Function