The error i get is runtime error 3061. "Too few parameters. Expected 2.
here is the code:
The underscored line is the one that Debug breaks on.
Any help would be great.
here is the code:
Code:
Private Sub Form_Load()
Dim dbs As DAO.Database
Dim TstVal As String
Dim StrSQL As String
Dim rsSql As DAO.Recordset
Set dbs = CurrentDb
TstVal = GetUserName()
StrSQL = "SELECT * FROM Table_Employees WHERE TABLE_Empolyees.Emp_PC_User_Name = " & TstVal & "; "
[u]Set rsSql = dbs.OpenRecordset(StrSQL, dbOpenSnapshot)[/u]
If Not rsSql.EOF Then
With rsSql
Me.QryEmpNam = TABLE_Employees.EMP_Name
End With
Set Rs = Nothing
End If
End Sub
Any help would be great.
Comment