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