vb.net - Click on a button to dispaly the next record in Ms Access Database -
i have records in dsatabase in access, table called "add form". have created form in vb delete selected record record table show in respective textboxes , user click delete delete record , either click next\previous navigate record. code next button:
if inc <> maxrows - 1 inc = maxrows - 1 navigaterecords() elseif inc = -1 msgbox("this first record") end if
the navigate function here :
private sub navigaterecords() student_idtextbox.text = ds.tables("add form").rows(inc).item(0) student_nametextbox.text = ds.tables("add form").rows(inc).item(1) date_of_birthdatetimepicker.text = ds.tables("add form").rows(inc).item(2) addresstextbox.text = ds.tables("add form").rows(inc).item(3) e_mailtextbox.text = ds.tables("add form").rows(inc).item(4) allergiestextbox.text = ds.tables("add form").rows(inc).item(5) emergency_contact_numbertextbox.text = ds.tables("add form").rows(inc).item(6) end sub
but giving me error:
object reference not set instance of object.
for first line of code under navigate sub.
please me program button go next record in database.
Comments
Post a Comment