Steve Turner
sturner at mseco.com
Thu Sep 25 13:32:37 CDT 2008
Hello List, I am using A2k with SQL Express, Excel, and other linked tables. The main DB is in SQL Express. We have a custom timesheet program that puts Time, Charges, Job numbers worked on in it. I used to export data to Lotus 2.1 using A2k and calculate cost for each Job to make entries to the GL. I have now written Query's to extract the data, calculate the cost and export to Excel so I can import to the GL. Calculations are done by the week because of Salaried Costs and the hours worked causes the Cost to change each week. I have a Query that sums the week by Job based on entered dates. I made a copy as a Make Table Query and a Copy to be an Append Query that writes the 4 or 5 weeks to a table to use another query to summarize by Job for the Month. I also have a Query that summarizes the data to 10 profit centers 0-9 as negative amounts to offset the GL. I know that there must be an easy way to use VBA code to automate the process but not quite sure how to start it as my coding ability is limited. We also have a Variable table built with the month start and month end date to run many other reports. We have a Form built with buttons to update the Variables table and run many reports from the database here. I would like to add a button that would run the code to build the GL Cost data from here. It will write the GL Queries to an Excel file. Simply I need to read Var table for month start then run Make Table query for 1st week. Read Var table for next week then run Append query for that week and continue to run the Append query for each week till month end is reached. Run query to sort down to Month table Then combine this table with Summary query of profit centers for GL and export this to Excel. Anyone have some code I can start with to do this? Steve A. Turner Controller Mid-South Engineering Co. Inc P.O. Box 1399 Hot Springs, AR 71902 E-Mail: sturner at mseco.com and saturner at mseco.com Phone:(501)321-2276 Fax: (501)321-4750