Results 1 to 7 of 7
  1. #1
    VAer is offline Competent Performer
    Windows 10 Access 2013 32bit
    Join Date
    Sep 2016
    Location
    USA
    Posts
    163

    Is there anyway to write VBA inside Access file?


    Does Access only deal with SQL?

    I have a excel file, which pulls a database table into excel file (this step requires SQL), then generate a new workbook with multiple sheets for pulled database table (this step requires VBA).

    It works fine, but there is an issue I am not able to fix. Here is the same issue posted by other: https://www.experts-exchange.com/que...ok-closed.html

    I am thinking if it is possible to move both steps (SQL and VBA) into Access? But I am not familiar with Access, and not sure if it takes VBA? Or how to let Access manipulate Excel file.

    Thanks.

  2. #2
    andy49's Avatar
    andy49 is offline VIP
    Windows 10 Access 2007
    Join Date
    Nov 2016
    Location
    London
    Posts
    1,051
    So you want to export a file into access using SQL and then manipulate the file using VBA access?

    If so, certainly possible.

  3. #3
    VAer is offline Competent Performer
    Windows 10 Access 2013 32bit
    Join Date
    Sep 2016
    Location
    USA
    Posts
    163
    No, I import one server database table into Access, then break the table down into multiple worksheets within one single excel file.

    One table in server database --> One excel file with multiple sheets

  4. #4
    aytee111 is offline Competent At Times
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    Not sure why you need VBA, a lot of calculations and data manipulation can be done through queries in Access. That being said, a query can call a VBA function, or it can be standalone. Once you have the data the way you want it then export it to Excel. This can be a straight export, or you can open an instance of Excel and populate the cells and format the worksheet using VBA in Access.

  5. #5
    aytee111 is offline Competent At Times
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    (Timing issue, didn't see your second post).

    Multiple worksheets are multiple queries exporting into worksheets. This can be done using a macro or VBA in Access. All these steps can be done in one procedure, either macro or VBA.

  6. #6
    VAer is offline Competent Performer
    Windows 10 Access 2013 32bit
    Join Date
    Sep 2016
    Location
    USA
    Posts
    163
    Quote Originally Posted by aytee111 View Post
    (Timing issue, didn't see your second post).

    Multiple worksheets are multiple queries exporting into worksheets. This can be done using a macro or VBA in Access. All these steps can be done in one procedure, either macro or VBA.
    Yes, that was my question, how to write VBA in Access? It is not just exporting, It is not like exporting a table to excel sheet, I still need to format that sheet, need to insert some other information (author, date, etc) in each sheet.

  7. #7
    aytee111 is offline Competent At Times
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936

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

Similar Threads

  1. Replies: 9
    Last Post: 02-18-2016, 10:38 AM
  2. Write Multiple file names to a text box
    By PoolHallJunkie in forum Programming
    Replies: 4
    Last Post: 09-16-2014, 01:16 PM
  3. Replies: 24
    Last Post: 07-08-2013, 12:59 PM
  4. Replies: 3
    Last Post: 02-22-2013, 06:41 AM
  5. Upload file inside .mdb database file
    By havish in forum Access
    Replies: 0
    Last Post: 07-30-2008, 07:35 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