AboutScottgem Expertise I can answer some questions on a wide variety of business applications, including MS Office, Lotus Smartsuite, Visio, Notes and many others.
Experience I have over 16 years of experience as an IT professional, supporting a wide variety of business applications.
Question QUESTION: Hey Scott,
I have table with records that look like this
Smith, Jim Business Lunch $50
Smith, Jim Business Travel Expense $30
Smith, Jim Legal Document Assembly $25
Summers, Tom Business Conference $100
Summers, Tom Community Columbia School $35
I would like to automatically (via a macro/quesry or VBA code) export the records in to 2 tables, basically put Smith records into 1 and Summers into 2.
Is there a way to do that?
I would need to export each of those 2 tables to excel and attach to outlook email.
Please let me know if you need me to describe this 'outrageous' project in detail.
thanks for your help
ANSWER: What you need to do is create a query that filters for each person. You then export that query (using TransferSpreadsheet) to Excel. You do NOT need to, nor should you, create separate tables. You can then create an Outlook e-mail wioth the spreadsheet attached.
Hope this helps,
Scott<>
Microsoft Access MVP 2007
Author: Microsoft Office Access 2007 VBA
---------- FOLLOW-UP ----------
QUESTION: Scott, thanks for that answer.
I am not clear on how to create a filter with out specifying the criteria. I have tried using Max and Min
on the name but I am not getting anywhere with that.
thanks
Irina
Answer Well, of course you have to specify criteria. What you are going to need to do is loop through a recordset of unique people. For each person, you use a querydef to replace the saved query with the filtered query for that person. You then export and e-m,ail befopre going on to the next person.
Hope this helps,
Scott<>
Microsoft Access MVP 2007
Author: Microsoft Office Access 2007 VBA