Results 1 to 8 of 8
  1. #1
    bruceaj is offline Novice
    Windows 8 Access 2013
    Join Date
    Jul 2014
    Posts
    3

    Can I use Access VBA to read from an Access db and construct a table from the data

    I need to develop a user form. Included on that form will be a table consisting column pairs of a check box and text field (extracted from an Access database). The user will review the text field. If user wants the data he will select the check box. After reviewing all the column pairs, the user will click a save button and I will build an EXCEL file from all the text fields selected



    I am fairly new to VBA so before I get started I need to know that it is possible to dynamically construct the table of column pairs.

    Thank you..

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    Should be possible; it would probably involve automation:

    http://support.microsoft.com/kb/210288
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    bruceaj is offline Novice
    Windows 8 Access 2013
    Join Date
    Jul 2014
    Posts
    3
    Thanks for the response. The link you gave me is for constructing the end result, namely an Excel table. Great. Thanks.

    Now, I need to know if I can dynamically build a table consisting of pair of items, namely consisting of a Check box and text field, using an Access table as the data source.

    Thanks again.

  4. #4
    essaytee's Avatar
    essaytee is offline Been around a while
    Windows 7 64bit Access 2010 32bit
    Join Date
    Oct 2008
    Location
    Melbourne, Australia
    Posts
    27
    Quote Originally Posted by bruceaj View Post
    Thanks for the response. The link you gave me is for constructing the end result, namely an Excel table. Great. Thanks.

    Now, I need to know if I can dynamically build a table consisting of pair of items, namely consisting of a Check box and text field, using an Access table as the data source.

    Thanks again.
    There are a number of methods, well two that come to my mind, SQL code and DAO.

    Here's a DAO sample: http://allenbrowne.com/func-DAO.html#CreateTableDAO

    Steve.
    Last edited by essaytee; 07-19-2014 at 01:23 AM. Reason: spelling

  5. #5
    bruceaj is offline Novice
    Windows 8 Access 2013
    Join Date
    Jul 2014
    Posts
    3
    That looks like what I need to get started. I'll study it and try to map it to my application.

    Thanks for the help.

  6. #6
    essaytee's Avatar
    essaytee is offline Been around a while
    Windows 7 64bit Access 2010 32bit
    Join Date
    Oct 2008
    Location
    Melbourne, Australia
    Posts
    27
    Quote Originally Posted by essaytee View Post
    There are a number of methods, well two that come to my mind SQL code or DAO.

    Here's a DAO sample: http://allenbrowne.com/func-DAO.html#CreateTableDAO

    Steve.
    Here's the direct SQL method, which can be handy for what I consider temporary operations.

    Google search "SQL Code Create Table" Here's two references, http://www.w3schools.com/sql/sql_create_table.asp and http://www.tutorialspoint.com/sql/sql-create-table.htm

    Add the SQL code to the SQL view component of a query.

    Steve.

  7. #7
    ssanfu is offline Master of Nothing
    Windows XP Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    You might also check out Ken Snell's site
    http://www.accessmvp.com/KDSnell/EXCEL_MainPage.htm

  8. #8
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,716
    It may be helpful to readers if you would tell us what the big picture is? You're using Access and Excel, is there a need for both?
    Can you tell us about the "item pairs"? I'm not suggesting there is anything wrong with your stated approach, I'd just like to know the issue this is going to solve.
    Good luck.

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

Similar Threads

  1. Export Access data to Excel as Read-only
    By rmmhie in forum Import/Export Data
    Replies: 1
    Last Post: 10-26-2013, 07:44 AM
  2. Form to update a table without read access
    By macroRoniAndCheese in forum Forms
    Replies: 2
    Last Post: 03-01-2013, 02:58 PM
  3. can a access database table be read-only?
    By princess-1 in forum Access
    Replies: 5
    Last Post: 10-24-2010, 07:52 PM
  4. Read Sql Express Table from MS Access
    By GUKGUK in forum Forms
    Replies: 1
    Last Post: 10-12-2010, 06:34 AM
  5. ODBC table read to blank Access table write
    By dibblejon in forum Access
    Replies: 2
    Last Post: 03-10-2010, 08:39 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