i have an access database which i upload.i am able to navigate and display the recordes from the database everything is fine(for saving time i have not included the code for the four navigation buttons).
My question is the following: i want to create another textbox where when i enter a name for example and by pressing a search button it would automatically fill the corrspoding textbox,in taht case it would be 'txtFirstName',this is the name of my textbox.
Dim inc As Integer Dim con As New OleDb.OleDbConnection Dim dbprovider As String Dim dbsource As String Dim ds As New DataSet Dim da As OleDb.OleDbDataAdapter Dim sql As String Dim MaxRows As Integer Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load Me.TblContactsTableAdapter.Fill(Me.AddressBookDataSet.tblContacts) dbProvider = "PROVIDER=Microsoft.Jet.OLEDB.4.0;" dbSource = "Data Source = C:/AddressBook.mdb" con.ConnectionString = dbprovider & dbsource con.Open() sql = "Select * from tblContacts" da = New OleDb.OleDbDataAdapter(sql, con) da.Fill(ds, "AdrressBook") con.Close() MaxRows = ds.Tables("AddressBook").Rows.Count inc = -1 End Sub Private Sub NavigateRecords() txtFirstName.Text = ds.Tables("AddressBook").Rows(inc).Item(1) End Sub
So far i have not found a solution or the solutiuons i have found are not understanble.
Thank you in advance.
Number of downloads: 26