Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 21088

displaying records to itgrid from database filtered by text picked in combo box

$
0
0
good day

i already populated my combo box with the supplier names successfully

but now i am having a problem displaying records to itgrid from database filtered by text picked in combo box

in which i need to display all products from the supplier i choose on the combo box.

here is my sample code

\code

Private Sub cmbSupplier_Changed()

Set conn = New ADODB.Connection
conn.Open CONNECT_DATA

Dim rst As ADODB.Recordset
Dim cmbSupplier As String

Set rst = New ADODB.Recordset
' rst.CursorLocation = adUseClient

strSQL = "SELECT * FROM Products WHERE Supplier = ' " & cmbSupplier.String & " '; AND MonthlyRequest=1 ORDER BY ProductName"

' Open the Recordset
rst.Open strSQL, conn, adOpenForwardOnly, adLockReadOnly, adCmdText

' Populate the Data in the DataGrid
Set itGMonthlySuppliesRequest.DataSource = rst

End Sub



\code

Viewing all articles
Browse latest Browse all 21088

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>