Results 1 to 7 of 7
  1. #1
    Jantu is offline Novice
    Windows XP Access 2003
    Join Date
    Dec 2014
    Posts
    4

    Access button to get record from excel

    I want to create an access form which has two buttons the first button fetch data when clicked, should pull one record from excel file and once i am done with the record i should be able to click on the second button submit which will save the record in a different excel file please advise how to complete these actions on access form.. I'm looking for code for both these buttons.

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    This is complicated. Requires VBA code to open Excel as an object and manipulate the object. Look at http://www.accessmvp.com/KDSnell/EXCEL_MainPage.htm

    Why do you need to do this? Why is data duplicated?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    Jantu is offline Novice
    Windows XP Access 2003
    Join Date
    Dec 2014
    Posts
    4
    No. The purpose is to make the user work from the record from access form, so that each record is assigned to individual fairly. And excel to be kept away from any data manipulation

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    That didn't really clarify anything for me.

    Did the referenced link give you some idea of what is involved?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    Jantu is offline Novice
    Windows XP Access 2003
    Join Date
    Dec 2014
    Posts
    4
    It was useful but not apt to my query. I'm simply looking for a vba code for two buttons. Which pulls one record from an excel file and once the actions are completed.. When I click the second button it should save that record in a different excel file. Please advise

  6. #6
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    I think the referenced link is relevant to your request. As I said, what you want is complicated. Requires opening Excel objects and manipulating in VBA. The referenced link has examples demonstrating that.

    Click on "Importing from EXCEL Workbook Files" and scroll down to the "Write Data From an EXCEL Worksheet into a Recordset using Automation (VBA)" example.

    Then click "Exporting from EXCEL Workbook Files" and scroll down to "Write Data From a Recordset into an EXCEL Worksheet using Automation (VBA)" example.

    You would not have to save the imported data into a recordset, could just populate variables in code and then use those variables to write to other workbook. The first step is understanding how to manipulate Excel objects in VBA.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  7. #7
    Jantu is offline Novice
    Windows XP Access 2003
    Join Date
    Dec 2014
    Posts
    4
    Thanks. For the speedy reply .. I'll go through it and try to understand.. Will get back if need any clarification

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 2
    Last Post: 10-15-2014, 12:30 PM
  2. Replies: 6
    Last Post: 06-04-2014, 12:00 AM
  3. Replies: 1
    Last Post: 06-10-2012, 03:41 PM
  4. Replies: 2
    Last Post: 03-19-2012, 05:08 AM
  5. Export Excel data to access on a button click
    By Grooz13 in forum Import/Export Data
    Replies: 0
    Last Post: 03-15-2011, 10:02 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums