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
create an application that performs the following operation with the employee file created by the application in programming challenge 1: uses an open dialog box to allow the user

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

CONTROL ARRAY The control array is a group of similar objects with similar name. Adding controls with control arrays uses less resource than simply adding the multiple controls

Visual Interface  Based On Visual Patterns: The visual user interface should create recognizable patterns and text will be used for differentiating the objects with similar pa

Develop a web page that is used for accepting information regarding stocks. Make sure the form carry out the possible validations. The simple instance code below merely illustrates

In this unit you have learned how to develop Web pages which use VBScript. You have learned to insert logic to your Web pages as along with any other programming application. You h

Create a VB calculator application that appears as in the screen shots below. The user enters numbers in the textboxes labelled Number 1 and Number 2. When a calculati

Numeric data types: The Integer, long integer are used for entire numbers. Single and doubles are related with the floating point numbers. Currency is related with numbers dea

DOCUMENT INTERFACES   A SDI (Single document interface) and the MDI (Multiple document interfaces) are the document interfaces. The MDI based applications can have numerous ch

Retrieval Methods: There are 3 ways to find a document. The primary method is a positional retrieval. This is achieved by keeping in mind where you left it. The next method is