Hi again,
Im using the below code to run a search in a form against an Access Database.
The string to find comes from a textbox called TxSearch
Private Sub CmdSearch_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CmdSearch.Click
Dim dr As DataRow
Dim dt As DataTable
dr = dt.Rows.Find("KeyToFind")
If dr Is Nothing Then
MsgBox("Not Found")
Else
Me.TxSearch.Text = dr.Item("No").ToString
End If
End Sub
How do i assign dt a value? I got this code from the MSDN online help. Im still a novice at this and am still trying to learn how to do this. This probably seems like the stupidest way of doing what im trying to do. Please help
Thanks in advance
D
Im using the below code to run a search in a form against an Access Database.
The string to find comes from a textbox called TxSearch
Private Sub CmdSearch_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CmdSearch.Click
Dim dr As DataRow
Dim dt As DataTable
dr = dt.Rows.Find("KeyToFind")
If dr Is Nothing Then
MsgBox("Not Found")
Else
Me.TxSearch.Text = dr.Item("No").ToString
End If
End Sub
How do i assign dt a value? I got this code from the MSDN online help. Im still a novice at this and am still trying to learn how to do this. This probably seems like the stupidest way of doing what im trying to do. Please help
Thanks in advance
D