Results 1 to 8 of 8

Thread: using ms acces with use in forms in add, delete, exit, update data record

  1. #1

    Thread Starter
    New Member
    Join Date
    Oct 2008
    Posts
    1

    Thumbs up using ms acces with use in forms in add, delete, exit, update data record

    hi
    how r u?
    i have a question like when i use ms access with making database in a table and use a forms and in a forms i want to add command button like add, update, delete, exit
    so give me reply
    as soon as possible
    thank u

  2. #2
    A SQL Server fool GaryMazzone's Avatar
    Join Date
    Aug 2005
    Location
    Dover,NH
    Posts
    7,493

    Re: using ms acces with use in forms in add, delete, exit, update data record

    So what is the question..... You can do all that no problem
    Sometimes the Programmer
    Sometimes the DBA

    Mazz1

  3. #3
    Software Carpenter dee-u's Avatar
    Join Date
    Feb 2005
    Location
    Pinas
    Posts
    11,127

    Re: using ms acces with use in forms in add, delete, exit, update data record

    Hi rajdip82, welcome to the forums!

    I have a link in my signature on adding records to Access database, have a look...
    Regards,


    As a gesture of gratitude please consider rating helpful posts. c",)

    Some stuffs: Mouse Hotkey | Compress file using SQL Server! | WPF - Rounded Combobox | WPF - Notify Icon and Balloon | NetVerser - a WPF chatting system

  4. #4
    Hyperactive Member
    Join Date
    May 2006
    Posts
    365

    Re: using ms acces with use in forms in add, delete, exit, update data record

    hello

    I do believe that you want to know how to add buttons onto your Access forms.

    1. Open your form in design view.
    2. Select a button from to control box.
    3. Place the button onto your form.
    4. Follow the instructions relating to what you want it to do.

    Record Operations for Add, Delete, Update.

    Kind regards

    Steve

  5. #5
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: using ms acces with use in forms in add, delete, exit, update data record

    Moved to Office Development
    Quote Originally Posted by GaryMazzone
    So what is the question
    What is the answer to Gary's question?

  6. #6
    Fanatic Member bharanidharanit's Avatar
    Join Date
    Oct 2008
    Location
    India
    Posts
    673

    Re: using ms acces with use in forms in add, delete, exit, update data record

    Hello,
    You can able to add,edit,update and delete records using ADODB. Project->Components->Microsoft ADO Data Control 6.0 (OLEDB)
    Add that to the form

    Now put 4 buttons as Add,Delete,Edit,Update

    coding:
    dim db as new ADODB.Connection
    dim rs as new ADODB.recordset

    private sub form_load()
    db.open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=G:\Final Full\EXE\horse.mdb;Persist Security Info=False"

    Bold contents must be your database path
    rs.open "Select * from details",db,3,2

    This bold contents must be your recorset name where to add the datas.

    end sub

    Private sub add_click()
    rs.addnew
    rs.fields(0) = text1.text
    rs.fields(1) = text2.text
    etc
    rs.update
    msgbox "Data Added"
    End sub

    If my post was helpful pls rate me

  7. #7
    A SQL Server fool GaryMazzone's Avatar
    Join Date
    Aug 2005
    Location
    Dover,NH
    Posts
    7,493

    Re: using ms acces with use in forms in add, delete, exit, update data record

    You should not be opening a recordset just to add records. You issue an Insert SQL statement on a connection object command property
    Sometimes the Programmer
    Sometimes the DBA

    Mazz1

  8. #8
    Software Carpenter dee-u's Avatar
    Join Date
    Feb 2005
    Location
    Pinas
    Posts
    11,127

    Re: using ms acces with use in forms in add, delete, exit, update data record

    Quote Originally Posted by bharanidharanit
    Hello,
    You can able to add,edit,update and delete records using ADODB. Project->Components->Microsoft ADO Data Control 6.0 (OLEDB)
    Add that to the form

    Now put 4 buttons as Add,Delete,Edit,Update

    coding:
    dim db as new ADODB.Connection
    dim rs as new ADODB.recordset

    private sub form_load()
    db.open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=G:\Final Full\EXE\horse.mdb;Persist Security Info=False"

    Bold contents must be your database path
    rs.open "Select * from details",db,3,2

    This bold contents must be your recorset name where to add the datas.

    end sub

    Private sub add_click()
    rs.addnew
    rs.fields(0) = text1.text
    rs.fields(1) = text2.text
    etc
    rs.update
    msgbox "Data Added"
    End sub

    If my post was helpful pls rate me
    Using data bound controls for DML are frowned upon since they are considered evil.
    Regards,


    As a gesture of gratitude please consider rating helpful posts. c",)

    Some stuffs: Mouse Hotkey | Compress file using SQL Server! | WPF - Rounded Combobox | WPF - Notify Icon and Balloon | NetVerser - a WPF chatting system

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width