visual studio - search the database and put it in textbox -
using vb 6 , adodb connection, when click search id, inputbox appear, when finds id wanted, automatically insert data of row corresponding textboxes.
here code, @ somepoint, not work, dont remember error post here when home, guys.
private sub cmdsearch_click() findemployee = inputbox("insert employee id") record.open ("select * employees id='" & findemployee & "'"), conn, 3, 3 if record.eof msgbox "no" & findemployee & " id not found!", vbcritical + vbokonly, "error search" set record = nothing else txtemployeeid.text = record!id txtlnames.text = record!lastname txtfnames.text = record!firstname txtmnames.text = record!middlename cmbgenders.text = record!gender bdates.value = record!birthdate txtbplaces = record!birthplace txtages = record!age txtaddress.text = record!address cmbeducattainments.text = record!educattainment txtnos.text = record!contactno cstarts.value = record!contractstart cends.value = record!contractend set record = nothing end if end sub
private sub cmdsearch_click() findemployee = inputtextbox.text record.open ("select * employees id='" & findemployee & "'"), conn, 3, 3 if record.eof msgbox "no" & findemployee & " id not found!", vbcritical + vbokonly, "error search" set record = nothing else record txtemployeeid.text = !id txtlnames.text = !lastname txtfnames.text = !firstname txtmnames.text = !middlename cmbgenders.text = !gender bdates.value = !birthdate txtbplaces = !birthplace txtages = !age txtaddress.text = !address cmbeducattainments.text = !educattainment txtnos.text = !contactno cstarts.value = !contractstart cends.value = !contractend set record = nothing end end if end sub
Comments
Post a Comment