Results 1 to 13 of 13
  1. #1
    neerajm575 is offline Novice
    Windows XP Access 97
    Join Date
    Nov 2010
    Posts
    8

    Ms Access 2007 - VBA code to pick up a text in excel sheet and display the same in textbox

    Hi Experts,

    I am struggling to write a VBA code that picks content placed in Sheet1 of excel workbook and then display the same in text box on the MS access form. I am sure this is simple for you!:-) Please help

    Many thanks for your help.

    Regards,
    Neeraj

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    Can you set a link to the Excel workbook?

    What code have you attempted?

    Why is Excel 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.

  3. #3
    neerajm575 is offline Novice
    Windows XP Access 97
    Join Date
    Nov 2010
    Posts
    8

    MS Access 2007

    Many Thanks for responding back to my query. To let you know I am still a learner. Tried various codes. Don't know what to share at this moment with you. However, I am attaching a access DB and excel.

    The requirement is to have a table updated in excel and same to be displayed in message box(with image) for sending email to staff.
    Refer to the form in attached MBD file.

    You may also suggest me a different way to do this.

    Many thanks for your help in advance.

    Regards,
    Neeraj
    Expense letter.zipExpense letter.zip
    Last edited by neerajm575; 03-16-2015 at 11:04 AM. Reason: Attachment missed

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    I cannot download nor review files until March 23. If you still need help then, make another post to get my attention.

    If the structure of the Excel sheet is simple enough, should be able to set a link to it and then use the link like an Access table, except cannot edit the data.
    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
    neerajm575 is offline Novice
    Windows XP Access 97
    Join Date
    Nov 2010
    Posts
    8
    No Problem, I can wait until March 23. Do suggest me the solution to the issue post March 23.

    Many thanks once again for your help & Support.

    Regards,
    Neeraj

  6. #6
    ssanfu is offline Master of Nothing
    Windows XP Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    In the meantime, you might look at Ken Snell's site at:

    Ken's ACCESS Examples and Information for Working With EXCEL Workbook Files
    http://www.accessmvp.com/kdsnell/EXCEL_MainPage.htm

  7. #7
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    Setting a link to Sheet1 is not practical. However, the Email_Database sheet can be linked. Why are there two sheets in the sample workbook?

    I am not clear on what you want to do. Do you want to import from Excel into Access or export from Access to Excel? Or is Excel even needed? Do you just want to send an email from Access?

    Sending emails from Access with data is common topic. Search forum. Here is one https://www.accessforums.net/program...ook-21903.html
    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.

  8. #8
    neerajm575 is offline Novice
    Windows XP Access 97
    Join Date
    Nov 2010
    Posts
    8
    Yes, The requirement is to update excel sheet with the data filtered from the query and then display the content in text box of the form and send email.

    The second sheet on excel workbook can be ignored.

    Thanks!

    Regards,
    Neeraj

  9. #9
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    Code in Access to update the Excel sheet will be complicated. Did you review the Ken Snell site referenced by ssanfu in post 6?

    If you want to email data from multiple records in the email body and not an attachment, that will also be complicated code.

    Not writing it for you. You will have to provide attempts for analysis.
    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.

  10. #10
    neerajm575 is offline Novice
    Windows XP Access 97
    Join Date
    Nov 2010
    Posts
    8
    If codes are complicated, can a report in access be created that can be displayed in text box and email can be send out?

    Regards,
    Neeraj

  11. #11
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    Certainly data from multiple fields can be concatenated into a single text string.
    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.

  12. #12
    neerajm575 is offline Novice
    Windows XP Access 97
    Join Date
    Nov 2010
    Posts
    8
    Can you guide me how can I do that.

    Thanks!

    Regards,
    Neeraj

  13. #13
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    Expression in a query or in textbox on form or report that is bound to table or query, like:

    [fieldname1] & " " & [fieldname2] & " " & [fieldname3]

    This is basic Access functionality.
    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.

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

Similar Threads

  1. Replies: 1
    Last Post: 06-18-2014, 09:39 PM
  2. Replies: 4
    Last Post: 01-24-2013, 06:30 PM
  3. Replies: 1
    Last Post: 05-01-2012, 03:52 AM
  4. Replies: 3
    Last Post: 08-18-2011, 07:31 AM
  5. Replies: 2
    Last Post: 11-16-2010, 10:55 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