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
Restricting The Vocabulary: The properly formed vocabulary is like an inverted pyramid. All easy to learn communication system follow this pattern. The canonical vocabulary in

Data types: The New data types were defined by using the typedef or #define statements. This was to allow the transition from 16 bit to 32 bit system. Some of the fresh data t

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

ToolTip: The ToolTip property is used to flash a message regarding a control object when the mouse pointer moves over that object for a couple of seconds. Pick a control and c

DEVICE CONTEXT The device context provides the essential drawing tools and the platform to draw. It helps to draw the text, shapes, lines etc. To create the device context, the

Goal Create a Visual Basic that allows a user to play a variation of Hangman. User Inputs • The user types a letter into the textbox. Functional Items 1. Read a series

I''m trying to create a program in VB.net that will basically load the page within itself and allow you to input data via the program rather than going to the actual site using you

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.

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

FEATURES OF USER INTERFACE DESIGN The features like how will the software's are used? Who will be the users? What will be the life of the software? During its lifetime how ofte