'i need to view employees record when type in emp id to view that row record
'please help me. thanks![]()
' or i need giv all project code for more infomation ?
Code:Private Sub cmdView_Click() Dim rs As New ADODB.Recordset Dim cn As New ADODB.Connection Dim strCNString As String strCNString = "Data Source=" & App.Path & "\PayrollBakeryDB.mdb" cn.Provider = "Microsoft Jet 4.0 OLE DB Provider" cn.ConnectionString = strCNString cn.Open With rs .Open "SELECT emp_id FROM Employees", cn, adOpenDynamic, adLockOptimistic Do Until .EOF If !emp_id = txtID.Text Then intFound = 1 End If .MoveNext Loop .MoveFirst If intFound = 0 Then MsgBox "Employee ID not found !", vbExclamation, "Search" txtID.Text = "" With txtID .SelStart = 0 .SetFocus End With End If End With 'i need to view employees record when type in emp id to view thet entire record 'please help me. thanks Dim rsx As New ADODB.Recordset rsx.Open "SELECT emp_id, position, Fname, Lname, age, dob, gender, address, phone, country, race, Staff_Type, basic_salary, salary_id FROM employees", cnn, adOpenDynamic, adLockPessimistic With EmpReport Set .DataSource = rsx .Show End With rsx.Close End Sub




Reply With Quote