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
MULTIPLE DOCUMENT INTERFACE (MDI) WINDOWS   The SDI (Single document interface) supports one open window or document at a particular time. Microsoft's notepad and paint are il

Dialog Based Application: The application which app wizard generates is based on the dialog template resource.

You can employ Do...Loop statements to run a block of statements indefinite number of times. The statements are repeated either whilst a condition is True or till a condition becom

INTRINSIC CONTROLS   The Intrinsic controls are the built-in controls. Few of the controls are Combo box, Check box, Command Button, Label etc. The controls have properties re

Deleting Records: To remove a record use the Delete method. To delete the record from the customer table follow the coding as shown below: data1.RecordSource = "Customer"

Function IsPalindrome(str) Dim iStart,iEnd,ctr,blnPalin str=trim(str) blnPalin=true iEnd=len(str) iCnt=round(iEnd / 2) iStart=1 for ctr=1 to cint(iCnt) if(mid(str,iEnd,

You are asked to create the LOTO game customized according to the following constraints: 1. Create a grid containing 20 numbers (20 buttons: button1, button2, …button20) 2. When t

Earlier versions of VBScript had no mechanism for making user-defined constants. Constants, if utilized, were implemented as variables & distinguished from other variables by using

want a visual basic code on Hungarian method

i have connected my visual basic 2010 express in ports and use it to send sms but it failed... now my teacher said that i have to use my LAN not port to send it instead..... please