Hello All,
In the code below I am trying to pull a specific value from the DB but is appears to ignore the variable I am sending the RS.
In the code below I am trying to pull a specific value from the DB but is appears to ignore the variable I am sending the RS.
Code:
Sub GetUserdetails()
Dim rs As DAO.Recordset
Dim stSql As String
Dim strGreeting As String
Set rs = Application.CurrentDb.OpenRecordset("tblUsers", dbOpenDynaset)
strUsername = UNameWindows ' the value of this is aaroni which does not exist in the DB
rs.FindFirst "fldUname=" & """ & strUsername & """
If Not rs.EOF Then
strPname = rs("fldPname") 'filled with the first row in the DB
intUserID = rs("fldUserID")'filled with the first row in the DB
End If
' Close the recordset and the database.
rs.Close
Set rs = Nothing
End Sub