Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Searcing foran Excel event fired. | Excel Worksheet Functions | |||
large database with multiple rows | Excel Worksheet Functions | |||
Excel Multisheets, submit button to update database sheet | Excel Discussion (Misc queries) | |||
Searcing throught using part of string | Excel Programming | |||
repost: searcing multi excel files... | Excel Programming |