I have a slight problem with how my records are being selected in my Payroll program. If I have two employees with identical Full Names, I am unable to show the records of one of them eventhough both have different id numbers and both names appear in my employee list screen. When I click on either names, the record comes up with the information that refers to the one with the lowest Id number. In both cases the Id number text box shows the lowest id number. Here is the code used for the query:
sqlquery3 = "select * from employee Where ((employee.company_id =" & Company_ID & " AND "
sqlquery3 = sqlquery3 & " (employee.[Full Name] ='" & frmEmployeeList.List1.List(frmEmployeeList.List1.ListIndex) & "')) "
Set rs3 = dbPayroll.OpenRecordset(sqlquery3, dbOpenDynaset, dbExecDirect, dbOptimistic)
I tried using select distinct, but there was no difference.
Cooleen
sqlquery3 = "select * from employee Where ((employee.company_id =" & Company_ID & " AND "
sqlquery3 = sqlquery3 & " (employee.[Full Name] ='" & frmEmployeeList.List1.List(frmEmployeeList.List1.ListIndex) & "')) "
Set rs3 = dbPayroll.OpenRecordset(sqlquery3, dbOpenDynaset, dbExecDirect, dbOptimistic)
I tried using select distinct, but there was no difference.
Cooleen