Hi experts, kimangel is here again, doubling my time. Thanks alot for helping.
I have problem with two tables, when I click cmdSearch button searching for Employees_IdNo error occur "The specified field 'Employees_IdNo' could refer to more one table in the FROM clause in your SQL statement.
below is my code:
Private Sub cmdSearch_Click() Dim sTrID As String sTrID = txtSearch.Text Set rs = New ADODB.Recordset rs.Open "Select * from Time_In, Time_Out where Employees_IdNo like '" & sTrID & "'", cn, adOpenKeyset, adLockPessimistic If Not rs.EOF Then Ado.RecordSource = "Select * from Time_In, Time_Out where Employees_IdNo Like '" & sTrID & "'" Ado.Refresh rs.Close Set rs = Nothing Else MsgBox "No records found! ", vbExclamation, "DailyRecords" End If End Sub
Edited 3 Years Ago by kimangel