I have been given an Access 2003 database which produces a report and then attaches that page to an email, based on complex criteria.
I have found the area in the code where it creates the rtf file and opens the mail client and attaches the file.
I have been asked to create a table and populate it with some details from all of the report pages which are attached as individual files to emails.
I can, in the immediate window, see the data which I need to write to the table, by using
? [Reports]![Invoices]![txtOrg] and ? [Reports]![Invoices]![CostCentre] for example.
I can add records to the table by using the following
set dbs = CurrentDb
dbs.execute "Insert into tblMonthlyJournals ([Organisation]) values ('testOrg')"
This adds a new record and enters testOrg into the Organisation field.
I need to replace the literal 'testOrg' with the contents of [Reports]![Invoices]![txtOrg], but have not been able to find a way of doing it.
Any help is gratefully appreciated.