sunilvedula
Sunil
- Local time
- Tomorrow, 02:33
- Joined
- Jan 18, 2007
- Messages
- 138
HI
i have been doing a project for my company. i am trying to develop a tool in access. My problem is that i am unable to pull records associated with an id. every time i give the id in the combo box in form it gives me back the result of the first record irrespective of the id i enter in combo box. Pls give me the code if possible. i am pasting the code which i have written. there are two table table 1. Employees table 2. Details.
Dim rs As ADODB.Recordset
Dim Cnxn As ADODB.Connection
Set Cnxn = New ADODB.Connection
Set rs = New ADODB.Recordset
Cnxn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source = J:\Disputes_PE\CORE\O4\O4.mdb"
Cnxn.Open
'rs.Open (["SELECT LineManager FROM TblEmployees where EmpID='" & CboxHbiid.Value & "'""], Cnxn)
or
set rs = cnxn.Execute ("SELECT LineManager FROM TblEmployees where EmpID='" & CboxHbiid.Value & "'"")
rs.Close
Cnxn.Close
i have been doing a project for my company. i am trying to develop a tool in access. My problem is that i am unable to pull records associated with an id. every time i give the id in the combo box in form it gives me back the result of the first record irrespective of the id i enter in combo box. Pls give me the code if possible. i am pasting the code which i have written. there are two table table 1. Employees table 2. Details.
Dim rs As ADODB.Recordset
Dim Cnxn As ADODB.Connection
Set Cnxn = New ADODB.Connection
Set rs = New ADODB.Recordset
Cnxn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source = J:\Disputes_PE\CORE\O4\O4.mdb"
Cnxn.Open
'rs.Open (["SELECT LineManager FROM TblEmployees where EmpID='" & CboxHbiid.Value & "'""], Cnxn)
or
set rs = cnxn.Execute ("SELECT LineManager FROM TblEmployees where EmpID='" & CboxHbiid.Value & "'"")
rs.Close
Cnxn.Close