I have an Access 2010 database with a VBA module that does some statistical data analysis. Statistical analysis results cannot be obtained by SQL, but they can be presented in tabular format. Right now I can run the VBA function in the Immediate window, and it will cycle through the results and write them to the terminal using Debug.Print ().
I would like the results of this feature to be available to the rest of Access so that I can create queries and reports from the results table. So I'm looking for how to turn my function into a “dynamic table” - a table that does not actually store data, but stores a VBA function that runs, and dynamically populates the table data whenever this table is used.
I spent a lot of time dynamically creating tables using MAKE TABLE queries or using DDL in VBA, but all these examples use SQL to create a new table from existing records. I cannot use SQL to generate the results, so I'm not sure how to force the results to an object that Access recognizes. Part of the problem is that I do not understand enough Access VBA terminology to know what I need to look for.
My expression is simply "Public Function GenerateSchedule". It has three blocks of code: the first extracts the data I need from the database using a query and processes the RecordSet into an array. The second block performs statistical analysis of the array, and the third prints the analysis results on the terminal. I would like to replace the third block with a block that provides the results in a table that can be used by the rest of Access.
Soren source share