Adding records - data control, Visual Basic Programming

Adding Records:

1. As in the earlier case Set the DatabaseName property as "C:\ex.mdb", now Set the Record Source for the data control as Customer and Set the Record Type to 0.

2. Design a form with 5 text boxes and 2 command buttons new and update.

3. Put the DataSource to Data1 for all the text boxes.

4. Place the DataField property for each and every text box to the various fields of the Customer table.

5. Handle the Click event for new command button and type the handler as shown below:

data1.RecordSource = "Customer"

data1.Refresh

data1.Recordset.AddNew

Now Add New adds a buffer in the memory for a new record.

6. Handle the Click event for the command button, update it and type the handler as shown below:

data1.Recordset("Id") = CInt(text1.Text)

data1.Recordset("name")= text2.Text

data1.Recordset("address")= text3.Text

data1.Recordset("city")= text4.Text

data1.Recordset("state")= text5.Text

data1.Recordset.Update

Now update marks the record into the database.

Posted Date: 10/10/2012 1:09:22 AM | Location : United States







Related Discussions:- Adding records - data control, Assignment Help, Ask Question on Adding records - data control, Get Answer, Expert's Help, Adding records - data control Discussions

Write discussion on Adding records - data control
Your posts are moderated
Related Questions
Tab Order: The tab order stands for the order in which the controls receive focus when the user clicks the tab key. The CTRL + D can be used to set the tab order of controls.

The Refresh Method: The refresh method transfer to the first record in the record set. To invoke the refresh method follow the syntax which is as shown below: Form1.Data1.R


In VBScript, the While...Wend statement is provided for those who are familiar along its usage. However, due to the lack of flexibility in While...Wend, it is suggested that you us

Methods: VBScript Err Object Clear Method Clears every property settings. Raise Method Generate a run-time error.

Problem 1. Describe the concept of exception in .Net environment 2. Explain the process of adding, updating and deleting records with an example 3. Explain DTD elements a

I have all my program done except the loan part that I am having a lot of troubles with

i need sample balance sheet form in vb.net

I have a project due tomorrow that I am really struggling in. Please help.

CLASS WIZARD The Class wizard shown in figure is a tool to handle the message handlers for objects, to define the member variables. Figure: Class Wizard