kalboako1987 Level: Trainee
 Registered: 14-11-2007 Posts: 2
|
help me auto populate
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..
Private Sub populate()
Dim xx As DataTable
xx = db1.doQuery("select idno from Enrollment where idno='" + Me.txtidno.Text + "'")
If xx.Rows.Count <> 0 Then
MessageBox.Show("existing", "WARNING!", MessageBoxButtons.OK, MessageBoxIcon.Warning)
xx = db1.doQuery("select Firstname, Middlename, Lastname, level1, preschoollevel,primarylevel,secondarylevel,tuitionfee, amountpaid,tobwithd,tobwithoutd from Enrollment where Firstname='" + Me.txtfirstname.Text + "', Middlename='" + Me.txtmi.Text + "', Lastname='" + Me.txtlastname.Text + "', level1 = '" + Me.ComboBox1.Text + "', preschoollevel='" + Me.cmbpreschool.Text + "', primarylevel='" + Me.cmbprimary.Text + "', secondarylevel ='" + Me.cmbsecondary.Text + "', tuitionfee='" + Me.TextBox5.Text + "', amountpaid ='" + Me.txtpreviousamountpaid.Text + "', tobwithd= '" + Me.txtbal.Text + "', tobwithoutd = '" + Me.txtbal.Text + "'")
[Edited by kalboako1987 on 15-11-2007 at 06:08 AM GMT]
|