hello guys
Im trying to autopopulate my form from a table in my database called Enrollment.it will fill the textboxes in my form whenever the id number typed in the textbox is existing in my database.. the selection will be based in the highest EnrollmentID whatever is the highest EnrollmentID that matches with id number will automatically fill the textboxes. i put these code inside my idnumber textbox by double clicking it. can somebody help me please...
i need all the advice that you can give me..
[code=vb]
Private Sub populate()
Dim xx As DataTable
xx = db1.doQuery("se lect idno from Enrollment where idno='" + Me.txtidno.Text + "'")
If xx.Rows.Count <> 0 Then
xx = db1.doQuery("se lect Firstname, Middlename, Lastname, level1, preschoollevel, primarylevel,se condarylevel,tu itionfee, amountpaid,tobw ithd,tobwithout d from Enrollment where Firstname='" + Me.txtfirstname .Text + "', Middlename='" + Me.txtmi.Text + "', Lastname='" + Me.txtlastname. Text + "', level1 = '" + Me.ComboBox1.Te xt + "', preschoollevel= '" + Me.cmbpreschool .Text + "', primarylevel='" + Me.cmbprimary.T ext + "', secondarylevel ='" + Me.cmbsecondary .Text + "', tuitionfee='" + Me.TextBox5.Tex t + "', amountpaid ='" + Me.txtpreviousa mountpaid.Text + "', tobwithd= '" + Me.txtbal.Text + "', tobwithoutd = '" + Me.txtbal.Text + "'")[/code]
Im trying to autopopulate my form from a table in my database called Enrollment.it will fill the textboxes in my form whenever the id number typed in the textbox is existing in my database.. the selection will be based in the highest EnrollmentID whatever is the highest EnrollmentID that matches with id number will automatically fill the textboxes. i put these code inside my idnumber textbox by double clicking it. can somebody help me please...
i need all the advice that you can give me..
[code=vb]
Private Sub populate()
Dim xx As DataTable
xx = db1.doQuery("se lect idno from Enrollment where idno='" + Me.txtidno.Text + "'")
If xx.Rows.Count <> 0 Then
xx = db1.doQuery("se lect Firstname, Middlename, Lastname, level1, preschoollevel, primarylevel,se condarylevel,tu itionfee, amountpaid,tobw ithd,tobwithout d from Enrollment where Firstname='" + Me.txtfirstname .Text + "', Middlename='" + Me.txtmi.Text + "', Lastname='" + Me.txtlastname. Text + "', level1 = '" + Me.ComboBox1.Te xt + "', preschoollevel= '" + Me.cmbpreschool .Text + "', primarylevel='" + Me.cmbprimary.T ext + "', secondarylevel ='" + Me.cmbsecondary .Text + "', tuitionfee='" + Me.TextBox5.Tex t + "', amountpaid ='" + Me.txtpreviousa mountpaid.Text + "', tobwithd= '" + Me.txtbal.Text + "', tobwithoutd = '" + Me.txtbal.Text + "'")[/code]
Comment