search problem in vb

Reply

Join Date: Mar 2007
Posts: 4
Reputation: nihar99 is an unknown quantity at this point 
Solved Threads: 0
nihar99 nihar99 is offline Offline
Newbie Poster

search problem in vb

 
0
  #1
Mar 25th, 2007
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
Reply With Quote Quick reply to this message  
Join Date: Mar 2007
Posts: 3
Reputation: buen is an unknown quantity at this point 
Solved Threads: 0
buen buen is offline Offline
Newbie Poster

Re: search problem in vb

 
0
  #2
Mar 31st, 2007
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...
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the Visual Basic 4 / 5 / 6 Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC