Access - Convert Column Names in one Table into Rows in another table

Posted on 2007-08-07
Last Modified: 2012-05-05
How can I get the column NAMES from one table and insert them as a record for each in another table

This is Access 2003

Question by:keschuster
    1 Comment
    LVL 119

    Accepted Solution


    sub getColumn()
    dim rs1 as dao.recordset, rs2 as dao.recordset, j as integer

    set rs1=currentdb.openrecordset("Table1")
    set rs2=currentdb.openrecordset("Table2")

    for j=0 to rs1.Fields.count-1

    set rs1=nothing
    set rs2=nothing
    end sub

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    PL/SQL can be a very powerful tool for working directly with database tables. Being able to loop will allow you to perform more complex operations, but can be a little tricky to write correctly. This article will provide examples of basic loops alon…
    Composite queries are used to retrieve the results from joining multiple queries after applying any filters. UNION, INTERSECT, MINUS, and UNION ALL are some of the operators used to get certain desired results.​
    In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.
    With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

    758 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    11 Experts available now in Live!

    Get 1:1 Help Now