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

[RESOLVED] How to display selected value in datagrid.vb6

$
0
0
I'm trying to get the value of medicine that has a quantity of less than 15 and display it in datagrid. For example I have paracetamol that has quantity of 15 or less then the paracetamol will automatically display in the datagrid. I have a table name inventory with the field names MedicineName, Genericname, StockQuantity etc. My problem here is all the records in database display.
Please help me. Thank you..

Here is my code in adodc connection
Select StockQuantity from inventory

Private Sub Form_Load()
Adodc2.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\clinic.mdb" & ";Persist Security Info=False"
Adodc2.RecordSource = "select * from inventory order by StockQuantity asc"
Set DataGrid2.DataSource = Adodc2
Adodc2.Refresh

IF StockQuantity <= 15 then Adodc2.Recordset(“StockQuantity”)
End if
End sub

Viewing all articles
Browse latest Browse all 21256

Trending Articles



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