vb.net - VB2008 event works like the Onchange or Afterchange events? -
i'm trying display information of sale bill depending on it's barcode after writing barcode press enter other information should loaded ... problem event use enter barcode!
i tried textchanged,enter,keydown-up-press , tooo many events, useless because not give me chance complete writing full barcode !! start checking data every single key press, work if paste barcode on textbox, not me need write barcode not paste :(
i did searches couldn't solve problem :( plz :(
private sub barcode_textchanged(byval sender object, byval e system.eventargs) dim cnn new oledb.oledbconnection dim rst new oledb.oledbdataadapter dim sql string dim dt new datatable dim lsp new oledb.oledbcommand cnn.connectionstring = "provider=microsoft.jet.oledb.4.0; data source=" & application.startuppath & "\database9.mdb" cnn.open() sql = "select materialname store code='" & barcode.text & "'" rst = new oledb.oledbdataadapter(sql, cnn) rst.fill(dt) matname.text = dt.rows(0).item("materialname") lsp = new oledb.oledbcommand("select last(saleprice)from store code='" & barcode.text & "'", cnn) dim sp integer = lsp.executescalar sprice.text = sp qty.text = 1 totalmat.text = sprice.text * qty.text listview1.items(0).text = matname.text listview1.items(0).subitems(1).text = qty.text listview1.items(0).subitems(2).text = val(sprice.text * qty.text) end sub
Comments
Post a Comment