wizard2773
New member
- Joined
- Jun 28, 2013
- Messages
- 1
- Programming Experience
- Beginner
Hi, how does one manage to make a textbox fetch data from a table record field in ms access database after selecting a record id in a combobox and the value in the textbox must keep changing with the record id in the combobox selected, i managed to make the combobox fetch the record id's from the table field.
Here is my code:
Imports System.Data.OleDb
Module Module1
Public acsconn As New OleDb.OleDbConnection
Public acsdr As OleDbDataReader
Public strsql As String
Sub connect()
acsconn.ConnectionString = "PROVIDER=Microsoft.ACE.OLEDB.12.0; data source=|datadirectory|\FranklinMachine.accdb;"
acsconn.Open()
End Sub
End Module
Public Class frmFranklinManager
Sub fillcombo()
strsql = "select * from tblFranklin"
Dim acscmd As New OleDb.OleDbCommand
acscmd.CommandText = strsql
acscmd.Connection = acsconn
acsdr = acscmd.ExecuteReader
While (acsdr.Read())
ComboBox1.Items.Add(acsdr("FranklinName"))
End While
acscmd.Dispose()
acsdr.Close()
End Sub
PLEASE HELP!
Here is my code:
Imports System.Data.OleDb
Module Module1
Public acsconn As New OleDb.OleDbConnection
Public acsdr As OleDbDataReader
Public strsql As String
Sub connect()
acsconn.ConnectionString = "PROVIDER=Microsoft.ACE.OLEDB.12.0; data source=|datadirectory|\FranklinMachine.accdb;"
acsconn.Open()
End Sub
End Module
Public Class frmFranklinManager
Sub fillcombo()
strsql = "select * from tblFranklin"
Dim acscmd As New OleDb.OleDbCommand
acscmd.CommandText = strsql
acscmd.Connection = acsconn
acsdr = acscmd.ExecuteReader
While (acsdr.Read())
ComboBox1.Items.Add(acsdr("FranklinName"))
End While
acscmd.Dispose()
acsdr.Close()
End Sub
PLEASE HELP!