I took this code from the Query SQL Its has three tables tblSurveyList , tblSurveylistsub and to update tbl_Export. Table tblSurveylistsub.SurveyListID_FK has multiple records that match tbl_surveylist.SurveyListID_PK . The records on Surveylistsub have different Fiscalyear dates which I am updating into the Export table.
Attachment 31546Attachment 31547
How would I run the same thing in a form design code to update the table tbl_export.
strSQL = "UPDATE (tblsurveylist LEFT JOIN tbl_Export ON tblsurveylist.[SurveyListID_PK] = tbl_Export.[SurveyListID_PK]) LEFT JOIN tblSurveylistSub ON tblsurveylist.[SurveyListID_PK] = tblSurveylistSub.[SurveyListID_FK]" & _
"SET tbl_Export.SurveyListID_PK = [tblsurveylist].[SurveyListID_PK], tbl_Export.SurveyName = [tblsurveylist].[SurveyName], tbl_Export.[FY 16/17] = [tblsurveylistsub].[FY], tbl_Export.[Kick off date1617] = [tblSurveylistSub].[KickOffDate], tbl_Export.[Design Start1617] = [tblSurveylistSub].[DesignStart], tbl_Export.[QDRC Testing Date1617] = [tblSurveylistSub].[QDRC_TestingDate], tbl_Export.[UAT Start1617] = [tblsurveylistsub].[UAT_Start], tbl_Export.[Collection Start1617] = [tblSurveylistSub].[CollectionStart]" & _
"WHERE tblSurveylistSub.[Fiscalyear] = [FY 16/17];"
DoCmd.RunSQL (strSQL)
CurrentDb.Execute strSQL, dbFailOnError