Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Apend information After An Even For Multiple Records

Status
Not open for further replies.

mikeythomas

Technical User
Aug 23, 2008
7
0
0
GB
Afternoon All,

I was wondering if someone could help as its driving me crazy.

I have a report (rptLetterAll) after I click a command button the report is generated based on parameters that are on the same form as the button.

What i want to happen is after the reports are generated or button clicked, i need certain information from the record source of the report to be sent to tblHistory.

So this is the scenario:

cmdOK is clicked 4 letters are generated.
CaseID, Date() from qryReport (the underlying datasource of the report) are appended to tblHistory for each letter that is produced. So 4 lines are appended to the history.

I have tried using the below after DoCmd.OpenReport.....

SQL = "INSERT INTO tblHistory ([CaseID], [HistoryDate]) & _
" Values('" & CaseID & "','" & strDate & "')"
CurrentProject.Connection.Execute SQL

But cant get it working!

Any help would be appreciated.

Cheers

Mike
 
Sorry about the typo on Append! Please dont hold that mistake against me!

Cheers
 
SQL = "INSERT INTO tblHistory ([CaseID], [HistoryDate])" & _

Also, this is an MS Access question which belongs in one of those forums, such as forum703

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top