• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Visual Basic [VB6]Create Your Own Address Book

Madd Eye

New Member
Joined
Jan 26, 2008
Messages
13
Reaction score
0
Step 1
Step 2
Step 3
Step 3a
Step 4
Step 4a


Step 1: Creating the form

Very simple to use, easy to set up and manipulate. Implement on many different projects of your choice. Doesnt require extensive knowledge of database design.

1. Start out by selecting "new project" from the File > New Project option. Resize the form and create 6 labels, 6 text boxes, 4 buttons and 1 databar from the toolbox. It should look something like this:
form_created.gif



Step 2: Setting the form properties


Now you have to set the properties of all the buttons, text boxes, the form and the databar.

(Name) Property:

* Text Boxes (From the Top) - txtName, txtLastName, txtAddress, txtPhone, txtEmail and txtComments
* Buttons (From the Top) - cmdExit, cmdAdd, cmdUpdate, cmdDelete
* Data-bar - databar

Caption property

* Labels (From the top) - 'First Name:' , 'Last Name' , 'Address', 'Phone', 'Email', 'Comments'
* Buttons (From the top) - 'Exit' , 'Add' , 'Update' , 'Delete'
* Databar: 'Last | Previous Next | Last'

Set the text of all the text boxes to blank, just delete everything that's under the Text Property.

After you have finished, it should look something like this:

form_named.gif


Save the form and the project; give it a name of "AddBook"


Step 3: Setting the form properties


Go to Add Ins > Visual Data Manager. Then in the visual data manager select File > New > Microsoft Access > Access 7.0. Save the file in the same folder that you have saved the form; give it a name of "AddBook_data"

Looks something like this:

visual_data_manager_select.gif


Notice the two buttons are highlighted in red; they should be selected.

Step 3a


In the database Window, right click and select "New Table"

database_window.gif


A window looking something like the one below should pop up:

build_table.gif


Give the table a name of "AddBook". Click the "Add Field" button and add a field with the name "first, last, email, phone, address, and comments". When completed, it should look like the one above. Click "Build the Table" on the bottom.

A new field appeared in you Database window named "Addbook". Right Click and select "Open":

open.gif


The fields that you have entered before are no located in that window. Now type in any 3 -5 entries. Don't forget to press "Update" and then "Add" after every entry.

Close the Visual Data Manager

Step 4

Now select the databar on the bottom of your form and set the following properties:

* RecordSource - Select the location of the Access.mbd file we created in the Visual Data Manager
* ReadOnly - False
* DatabaseName - Select the location of the Access.mbd file we created in the Visual Data Manager

Select Each of the text Boxes and set datasource property to databar

Select each of the text boxes (From the top) and set the DataField property to the corresponding name:

* txtFirst - first
* txtLast - last
* txtEmail - email
* txtPhone - phone
* txtAddress - address
* txtComments - comments

Step 4a

Now double click on the "Exit" button we added earlier and insert the following code:

Private Sub cmdExit_Click()
End
End Sub

Double Click on the "Add" button and insert the following code:

Private Sub CmdAdd_Click()
databar.Recordset.AddNew
End Sub

Double Click the "Update" button and insert the following code:

Private Sub Command3_Click()
databar.Recordset.Edit
End Sub

Double Click the "Delete" button and insert the following code:

Private Sub cmdDelete_Click()
databar.Recordset.Delete
databar.Recordset.MovePrevious
End Sub

Now save the project and run it. Correct all the spelling and stupid mistakes you made and have fun.
Downlaod it here

 
You should post credits from the person who created this tutorial if you didnt make it. Everyone can copy/paste ;)
 
/\ Agreed.

On topic: The adressbook can be handy :p But did you make it or did you copy and pasted the tutorial from another site?
 
You should post credits from the person who created this tutorial if you didnt make it. Everyone can copy/paste ;)

What makes you think he copied it? Pretty much everyone can write a tutorial aswell?
 
What makes you think he copied it? Pretty much everyone can write a tutorial aswell?

When a new member starts posting tutorials I think it is understandable to be a little suspicious if no sources are given. It's not like we have anything against this guy, but we did ask him in an other thread if he made the tutorial and he didn't give credits and later on he did it.

@ Madd Eye: Don't forget to give credits for every tutorial you are posting here if you haven't done it... Try to remember it for the next time :)
 
Last edited:
Broken link

Step 1
Step 2
Step 3
Step 3a
Step 4
Step 4a


Step 1: Creating the form

Very simple to use, easy to set up and manipulate. Implement on many different projects of your choice. Doesnt require extensive knowledge of database design.

1. Start out by selecting "new project" from the File > New Project option. Resize the form and create 6 labels, 6 text boxes, 4 buttons and 1 databar from the toolbox. It should look something like this:
form_created.gif



Step 2: Setting the form properties


Now you have to set the properties of all the buttons, text boxes, the form and the databar.

(Name) Property:

* Text Boxes (From the Top) - txtName, txtLastName, txtAddress, txtPhone, txtEmail and txtComments
* Buttons (From the Top) - cmdExit, cmdAdd, cmdUpdate, cmdDelete
* Data-bar - databar

Caption property

* Labels (From the top) - 'First Name:' , 'Last Name' , 'Address', 'Phone', 'Email', 'Comments'
* Buttons (From the top) - 'Exit' , 'Add' , 'Update' , 'Delete'
* Databar: 'Last | Previous Next | Last'

Set the text of all the text boxes to blank, just delete everything that's under the Text Property.

After you have finished, it should look something like this:

form_named.gif


Save the form and the project; give it a name of "AddBook"


Step 3: Setting the form properties


Go to Add Ins > Visual Data Manager. Then in the visual data manager select File > New > Microsoft Access > Access 7.0. Save the file in the same folder that you have saved the form; give it a name of "AddBook_data"

Looks something like this:

visual_data_manager_select.gif


Notice the two buttons are highlighted in red; they should be selected.

Step 3a


In the database Window, right click and select "New Table"

database_window.gif


A window looking something like the one below should pop up:

build_table.gif


Give the table a name of "AddBook". Click the "Add Field" button and add a field with the name "first, last, email, phone, address, and comments". When completed, it should look like the one above. Click "Build the Table" on the bottom.

A new field appeared in you Database window named "Addbook". Right Click and select "Open":

open.gif


The fields that you have entered before are no located in that window. Now type in any 3 -5 entries. Don't forget to press "Update" and then "Add" after every entry.

Close the Visual Data Manager

Step 4

Now select the databar on the bottom of your form and set the following properties:

* RecordSource - Select the location of the Access.mbd file we created in the Visual Data Manager
* ReadOnly - False
* DatabaseName - Select the location of the Access.mbd file we created in the Visual Data Manager

Select Each of the text Boxes and set datasource property to databar

Select each of the text boxes (From the top) and set the DataField property to the corresponding name:

* txtFirst - first
* txtLast - last
* txtEmail - email
* txtPhone - phone
* txtAddress - address
* txtComments - comments

Step 4a

Now double click on the "Exit" button we added earlier and insert the following code:

Private Sub cmdExit_Click()
End
End Sub

Double Click on the "Add" button and insert the following code:

Private Sub CmdAdd_Click()
databar.Recordset.AddNew
End Sub

Double Click the "Update" button and insert the following code:

Private Sub Command3_Click()
databar.Recordset.Edit
End Sub

Double Click the "Delete" button and insert the following code:

Private Sub cmdDelete_Click()
databar.Recordset.Delete
databar.Recordset.MovePrevious
End Sub

Now save the project and run it. Correct all the spelling and stupid mistakes you made and have fun.
Downlaod it here


The following link : http://acky.net/tutorials/vb/addressbook/address.zip appears to be broken. Of course, it could be that the page has been removed. The related pictures links on the preceding page in between the text also appear to be broken. TF7

- - - Updated - - -

http://acky.net/tutorials/vb/addressbook/address.zip link broken. http://otland.net/f481/vb6-create-your-own-address-book-3770/ - the picture links on this page also appear to be broken. TF7
 
Back
Top