I have 2 tables that I must retrieve data from via an ODBC driver. The linking between these 2 tables has caused some major performance issues. The tables are an AP Invoice table and an AR Invoice table. These are related through a Sales Order Number field (both tables have this field). Please don't ask for details as to why these are related, just accept it because it's way too complicated to get into.
Anyway, all I need to do is print a report with fields from both tables. I am more of a Crystal Report programmer so I initially did this through Crystal using the ODBC driver. There were only 50 records in my tests and it took almost an hour to get anything at all. Sometimes it simply locked up.
So, I thought I'd write a simple SQL query to get the data. I did this through WinSQL and it had the same result. Therefore, I figured it must have something to do with the ODBC driver. I am not able to create new indices because of its limitations either.
I imported the tables directly into Access, linked the tables, and ran a query. BANG...2 seconds later I had all the information. I created an Access report (since I am sick of Crystal for today) and it looks great. Now my problem is, how do I update these imported tables each time the report is run?
I tried simply using the "Link tables" feature pointing directly to the database but that took me back to 2 hours of waiting. So, the only way I've discovered to quickly get the data is through the importing the tables.
I have created a form with parameters to enter. These parameters are used in the query that the report is based off of.
I would like the 2 tables to be re-imported using the ODBC driver whenever the FormLoad event is triggered. Can someone help me out the VBA code to do this? I am a little familiar with VB but have not had any luck to this point.
I really appreciate it.
Anyway, all I need to do is print a report with fields from both tables. I am more of a Crystal Report programmer so I initially did this through Crystal using the ODBC driver. There were only 50 records in my tests and it took almost an hour to get anything at all. Sometimes it simply locked up.
So, I thought I'd write a simple SQL query to get the data. I did this through WinSQL and it had the same result. Therefore, I figured it must have something to do with the ODBC driver. I am not able to create new indices because of its limitations either.
I imported the tables directly into Access, linked the tables, and ran a query. BANG...2 seconds later I had all the information. I created an Access report (since I am sick of Crystal for today) and it looks great. Now my problem is, how do I update these imported tables each time the report is run?
I tried simply using the "Link tables" feature pointing directly to the database but that took me back to 2 hours of waiting. So, the only way I've discovered to quickly get the data is through the importing the tables.
I have created a form with parameters to enter. These parameters are used in the query that the report is based off of.
I would like the 2 tables to be re-imported using the ODBC driver whenever the FormLoad event is triggered. Can someone help me out the VBA code to do this? I am a little familiar with VB but have not had any luck to this point.
I really appreciate it.