hi all!!

im using ADODC as the connection with MS access.

hw can get the selected data in the datagrid on the click of the command button?

i.e If user want the employee info from company then user enters the emp code and by pressing 'search' command button user gets the info in the datagrid. im nt able to bring the related data in the grid.

plz help its urgent....

nihar99

Hello,

Try to use this code as a guide:

code in combo box or text under change

If rs.State = 1 Then: rs.Close
rs.Open " Select * From TableName Where RecordSource like '" & comboname/textname & "%'", db, adOpenKeyset, adLockPessimistic
Set DataGrid.DataSource = rs

:cheesy:

Hope you may find it well...