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
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