You are here:

Visual Basic/VB6 (How to Update?)

Advertisement


Question
Hello sir Kevin, I am a beginner in VB6 so i just want to ask about on how to update a record(s) or updating an existing records. I want to create a system for our school where we can keep track of the students records and payments. The task of this system is that it can Add, Save, Edit, Update and Delete records. For ex., we want to update the record of all the students who paid their tuition before the exam. The overall tuition of a student is P12,000 then if the student wants to pay P6,000, the tuition will be deducted by his/her payment so the current balance will be 6,000. The next time again the student will pay, the current balance will be deducted. So my problem now is that i don't know how to update the records every time the student will pay their tuition(s). Thank you in advance sir Kevin for your help and i really appreciate it. GOD BLESS!!!

Answer
Hi Edsel,
I am assuming you are using Microsoft Access, set up your connection to the database, have already declared a variable for your database and recordset, etc.

In order to Add a new record you would use:
recordset.addnew

In order to delete a record you would use
recordset.delete

In order to update a record you would use
recordset.update

Keep in mind however their will be a little more that just this line of code such as data validation.

Take a look at this link it goes a little deep than I do.  One poster even gave some code samples
http://www.daniweb.com/software-development/visual-basic-4-5-6/threads/119916/sa

Kevin

Visual Basic

All Answers


Answers by Expert:


Ask Experts

Volunteer


Kevin Watkins

Expertise

I have written several programs integrating with MS Office including Access, Excel, and Word. I have used control arrays as well as data arrays, text files. I have an associates degree in programming. Please do not ask questions about VBA or dot net. I can only answer questions about Visual Basic 6.

Experience

I have written several programs integrating with MS Office including Access, Excel, and Word. I have used control arrays as well as data arrays, text files. I have an associates degree in programming.

Education/Credentials
I have an associates degree in computer programming.

©2016 About.com. All rights reserved.