troubleshooting Question

Loop through ADOX columns in order displayed by table, not in alphabetical order

Avatar of chrisezard
chrisezardFlag for United Kingdom of Great Britain and Northern Ireland asked on
Microsoft Access
13 Comments1 Solution828 ViewsLast Modified:
I am writing a sub to build continuous forms using Access 2003 and ADO.

This code works, but returns the columns in alphabetical order...

    Set cat = New ADOX.Catalog
    Set col = New ADOX.Column        
    cat.ActiveConnection = CurrentProject.Connection
   
     For Each col In cat.Tables(strRecordSource).Columns
     
        Code to build Textboxes and Labels...

     Next col

strRecordSource refers to any named Table or Query

How do you get the columns to appear in the same order as they are in strRecordSource?
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 13 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 13 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros