+ Reply to Thread
Results 1 to 9 of 9
  1. #1
    Registered User
    Join Date
    04-04-2009
    Location
    Nashville, TN,USA
    MS-Off Ver
    Excel 2007
    Posts
    78

    Add to a database with a control button?

    Ok I have a form where our employees enter in some info and press the add button. I want this add button to take the data entered and transfer it to a database. Each time the button is pressed it needs to drop a row and add the new information entered. I have including my workbook.
    Attached Files Attached Files

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & read 2007
    Posts
    15,497

    Re: How do I add to a database with a control button?

    Hello rbyrd023,

    You will get more answers to question if post your workbook in Excel 2003 format. The more people who can view your workbook, the faster the turn around will be.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Forums Administrator royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    24,447

    Re: How do I add to a database with a control button?

    See the Contacts form here

    http://excel-it.com/

    The code will adapt to do what you want
    Hope that helps.

    RoyUK
    --------
    If you are pleased with a member's answer then use the Star icon to rate it, if you are pleased enough to part with cash consider a donation to Children in Need

    For Excel consulting, free examples and tutorials visit Excel Consulting-Excel VBA
    Check out the free Excel Toolbar

    New members please read & follow the Forum Rules

    Remember to mark your questions Solved and rate the answer(s)


    Code Tags: Make your code easier for us to read

  4. #4
    Registered User
    Join Date
    04-04-2009
    Location
    Nashville, TN,USA
    MS-Off Ver
    Excel 2007
    Posts
    78

    Re: How do I add to a database with a control button?

    Thank you very much for the reminder. Here is the 2003 version of my workbook. Thanks to all!!
    Attached Files Attached Files

  5. #5
    Forums Administrator royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    24,447

    Re: How do I add to a database with a control button?

    have you checked the download that I suggested?
    Hope that helps.

    RoyUK
    --------
    If you are pleased with a member's answer then use the Star icon to rate it, if you are pleased enough to part with cash consider a donation to Children in Need

    For Excel consulting, free examples and tutorials visit Excel Consulting-Excel VBA
    Check out the free Excel Toolbar

    New members please read & follow the Forum Rules

    Remember to mark your questions Solved and rate the answer(s)


    Code Tags: Make your code easier for us to read

  6. #6
    Registered User
    Join Date
    04-04-2009
    Location
    Nashville, TN,USA
    MS-Off Ver
    Excel 2007
    Posts
    78

    Re: How do I add to a database with a control button?

    I went to the site, but couldn't find anything...... today is one of those off my rocker days!!!

  7. #7
    Forums Administrator royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    24,447

    Re: How do I add to a database with a control button?

    Hope that helps.

    RoyUK
    --------
    If you are pleased with a member's answer then use the Star icon to rate it, if you are pleased enough to part with cash consider a donation to Children in Need

    For Excel consulting, free examples and tutorials visit Excel Consulting-Excel VBA
    Check out the free Excel Toolbar

    New members please read & follow the Forum Rules

    Remember to mark your questions Solved and rate the answer(s)


    Code Tags: Make your code easier for us to read

  8. #8
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & read 2007
    Posts
    15,497

    Re: Add to a database with a control button?

    Hello rbyrd023,

    In the event you are having trouble adapting the example, I have updated your "Add" button to copy the information. The code below has been added to the attached workbook.
    Code:
    Sub AddButton()
    '
    ' AddButton Macro
    '
      Dim DstRng As Range
      Dim DstRngEnd As Range
      Dim I As Long
      Dim Items As Variant
      Dim SrcWks As Worksheet
      
        Set SrcWks = Worksheets("Information Sheet")
        Set DstWks = Worksheets("Sheet2")
        
        Set DstRng = DstWks.Range("A2")
        Set DstRngEnd = DstWks.Cells(Rows.Count, DstRng.Column).End(xlUp)
        Set DstRng = IIf(DstRngEnd.Row < DstRng.Row, DstRng, DstRngEnd.Offset(1, 0))
           
        Items = Array("E19", "G8", "E11", "I12", "E13", "E15", "E21", "E23", "I21")
        
          For I = 0 To UBound(Items)
            DstRng.Offset(0, I) = SrcWks.Range(Items(I))
          Next I
            
    End Sub
    Attached Files Attached Files
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  9. #9
    Registered User
    Join Date
    04-04-2009
    Location
    Nashville, TN,USA
    MS-Off Ver
    Excel 2007
    Posts
    78

    Re: Add to a database with a control button?

    Great!! The code works! Thank you very much

    The "control form" on the website suggested is Great Too! Thank you very much

    Where would I be without this community????? LOST!

    Thanks Again Everybody!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.2.0