greetings everyone!. I'm making Clinic system for my project. I just want to ask how to get the total quantity of the medicine and display it on textbox. I'm using using vb6 and adodc. Any help will be greatly appreciated.Thank you...

Table name inventory
fields: Medicinename
StockQuantity

Recommended Answers

All 2 Replies

cmd = "select sum(StockQuantity) as Qty from inventory where MedicineName='" & selectionVariable & "'"
open recordset with cmd
with recordset
  txtField.text = CStr(!Qty)
  .close
end with
rs="Select StockQuantity from inventory",connection,3,3
txtbox1.text=""

while not rs.eof
    txtbox1.text=val(txtbox1.text)+ rs!StockQuantity
wend

Hope it help tanx

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.