Hi, I running a form that searches in an access database,
I want to know what happens in case there are more than one matches.
I'm using the dao.Recordset.seek function to search.
How can I get all of the matches into one label???
Thanks,
Kadosh1000
search in access Database - VB 2005
Started by kadosh1000, Jan 23 2009 01:10 PM
1 reply to this topic
#1
Posted 23 January 2009 - 01:10 PM
|
|
|
#2
Posted 24 January 2009 - 11:55 AM
i did it by my self :
Dim i As Integer = 0
Dim se as string
Label4.Text = ""
Label5.Text = ""
se = TextBox1.Text
TextBox1.Text = ""
Table.Index = "Se"
Table.Seek("=", se)
If Table.NoMatch Then
MsgBox("השם לא נמצא", MsgBoxStyle.Critical, "לא נמצא")
Else
Do While Not Table.EOF
Dim na(i), us(i) As String
If Table.Fields("Name").Value = se Then
us(i) = Table.Fields("User").Value
na(i) = Table.Fields("Name").Value
If Label4.Text = "" Then
Label4.Text = us(i)
Label5.Text = na(i)
Else
Label4.Text = Label4.Text & vbCrLf & us(i)
Label5.Text = Label5.Text & vbCrLf & na(i)
End If
Table.MoveNext()
i += 1
Else
Table.MoveNext()
End If
Loop
End If


Sign In
Create Account

Back to top









