LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default ad button for different rows after searcing in database


dear all,

i have a problem to add buttons with different rows after user type
keyword to search records in Access database. Button will be added an
point to the unique vid.

the searching function works but i don't know how to add row button
for user to click the differenct records. Pls help!!!

here is the code:
Private Sub CommandButton1_Click()

Dim rst As New ADODB.Recordset
rst.ActiveConnection = _
" Provider=Microsoft.Jet.OLEDB.4.0;" & _
" Data Source=d:\db1.mdb"

keyword = Trim(TextBox1.Text)
If keyword < " " Then
strSQL = " SELECT * From summary WHERE v_id LIKE '%" & keyword
"%' " & _
"OR v_name LIKE '%" & keyword & "%' " & _
"OR t_size LIKE '%" & keyword & "%' " & _
"OR r_rate LIKE '%" & keyword & "%' Order By v_id Asc"

rst.Open strSQL
Range("A8..J100").Clear
Range("A8").Select

Do While Not rst.EOF()
For k = 0 To 4
ActiveCell.Offset(0, k).Value = rst.Fields(k)
Next
ActiveCell.Offset(1, 0).Select
rst.MoveNext
Loop
rst.Close
End If
End Sub


thanks,
tsum

--
tsumik
-----------------------------------------------------------------------
tsumiki's Profile: http://www.excelforum.com/member.php...fo&userid=3335
View this thread: http://www.excelforum.com/showthread.php?threadid=53189

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Searcing foran Excel event fired. Dwipayan Das Excel Worksheet Functions 1 July 7th 08 08:46 AM
large database with multiple rows Steve Excel Worksheet Functions 2 January 14th 08 02:04 PM
Excel Multisheets, submit button to update database sheet [email protected] Excel Discussion (Misc queries) 1 April 13th 07 02:26 PM
Searcing throught using part of string bundyloco[_4_] Excel Programming 3 August 18th 05 08:01 PM
repost: searcing multi excel files... Scott Excel Programming 14 April 24th 05 04:51 PM


All times are GMT +1. The time now is 04:33 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"