หนูให้โค้ดนี้ค่ะ
Public Function LoadAllTool()
'โหลดข้อมูล รหัสอุปกรณ์ ลงใน ComboBox
Dim objConn As New OleDbConnection
Dim dtAdapter As OleDbDataAdapter
Dim ds As New DataSet
Dim strSQL As String
Connection(objConn)
strSQL = "SELECT * FROM Tool "
dtAdapter = New OleDbDataAdapter(strSQL, objConn)
dtAdapter.Fill(ds)
With ComboBox2
.DataSource = ds.Tables(0)
.DisplayMember = "Tool_ID"
.ValueMember = "Tool_ID"
End With
ComboBox2.SelectedItem = 0
Return True
End Function