I am working on an access 2010 database and needs some help.
I am trying to create some vba code that will run a query and then create and populate a table based on the records returned. I then want to rename the table based on a value from the query (company name).
I have the query built that will return distinct values from my table, but I need to create a seperate table for each company that is returned in the results.
Any and all suggestions are appreciated.
Are you sure that it is a good idea to create a different table for every company? I would not reccommend that!
Okay let’s say that you have your query, named QUERY, that contains the field CompanyName and contains all of the records. You could start with something like this:
This is just an idea… you should add more error checking code, and you should also escape company name or make sure it doesn’t contain any special character.