Visual Basic [VB6]Create Your Own Address Book

Discussion in 'Programming & Scripting' started by Madd Eye, Feb 24, 2008.

  1. Madd Eye

    Madd Eye New Member

    Joined:
    Jan 26, 2008
    Messages:
    13
    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:
    [​IMG]


    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:

    [​IMG]

    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:

    [​IMG]

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

    Step 3a


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

    [​IMG]

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

    [​IMG]

    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":

    [​IMG]

    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

  2. Master-m

    Master-m Need help? Just ask!

    Joined:
    May 28, 2007
    Messages:
    4,348
    You should post credits from the person who created this tutorial if you didnt make it. Everyone can copy/paste ;)
  3. Snel pUppie

    Snel pUppie Premium User Premium User

    Joined:
    Jun 15, 2007
    Messages:
    1,631
    /\ 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?
  4. Mark

    Mark Administrator Staff Member Administrator

    Joined:
    May 27, 2007
    Messages:
    5,938
    What makes you think he copied it? Pretty much everyone can write a tutorial aswell?
  5. JayBeee

    JayBeee Retired Global Mod Premium User

    Joined:
    Jun 2, 2007
    Messages:
    5,232
  6. Snel pUppie

    Snel pUppie Premium User Premium User

    Joined:
    Jun 15, 2007
    Messages:
    1,631
    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: Feb 25, 2008
  7. Madd Eye

    Madd Eye New Member

    Joined:
    Jan 26, 2008
    Messages:
    13
    Oj i will remember this :p
  8. Deaktiver

    Deaktiver Materia

    Joined:
    Nov 25, 2007
    Messages:
    633
    Madd Eye copyed this TUT from the Site where he "learned" it.
  9. Delirium

    Delirium Deception - Illuminatus Staff Member Global Moderator Premium User

    Joined:
    May 28, 2007
    Messages:
    3,224
    Omg wow you're evolving o_O I didn't know that ¬¬


    Ontopic:

    Could be handy for begginers :)
  10. tf7

    tf7 New Member

    Joined:
    May 19, 2013
    Messages:
    1
    Broken link

    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

Share This Page