Below is a SQL that I pasted from design view of an Append query - I am tryin'to run this query from a button on a form. I keep gettin' a "join expression error" or a "syntax error on the FROM part".....
Any suggestions or examples I can mess with...??
thanks in advance..!!
jw5107
DoCmd.RunSQL "INSERT INTO CoverSheetMstr ( FleetID, SchdDocID, CvrSheetID, CoverNo, MxLocID, ACID, MatID, Appendix, SchdDate )" & _
"SELECT DISTINCTROW PartMstr.FleetID, DocMstr.SchdDocID, CoverSheetNos.CvrSheetID, CoverSheetNos.CoverNo, MxLocMstr.MxLocID, AircraftMstr.ACID, PartMstr.MatID, " & Me!Appendix & ", " & Me!SchdDate & " " & _
"FROM FleetMstr " & _
"LEFT JOIN CoverSheetNos" & _
"ON FleetMstr.FleetID = CoverSheetNos.Fleet" & _
"INNER JOIN AircraftMstr ON FleetMstr.FleetID = AircraftMstr.FleetID" & _
"INNER JOIN DocMstr" & _
"INNER JOIN PartMstr" & _
"ON DocMstr.SchdDocID = PartMstr.SchdDocID" & _
"ON FleetMstr.FleetID = DocMstr.FleetID" & _
"INNER JOIN MxLocMstr" & _
"ON FleetMstr.FleetID = MxLocMstr.FleetID" & _
"WHERE (((PartMstr.FleetID) = " & Me!cbofleet & ") And ((DocMstr.SchdDocID) = " & Me!cboFind & ") And ((CoverSheetNos.CvrSheetID) = " & Me!cboCoverShtNo & ") And ((AircraftMstr.ACID) = " & Me!cboAC & ") And ((MxLocMstr.MxLocID) = " & Me!cboGTWY & "))
Any suggestions or examples I can mess with...??
thanks in advance..!!
jw5107
DoCmd.RunSQL "INSERT INTO CoverSheetMstr ( FleetID, SchdDocID, CvrSheetID, CoverNo, MxLocID, ACID, MatID, Appendix, SchdDate )" & _
"SELECT DISTINCTROW PartMstr.FleetID, DocMstr.SchdDocID, CoverSheetNos.CvrSheetID, CoverSheetNos.CoverNo, MxLocMstr.MxLocID, AircraftMstr.ACID, PartMstr.MatID, " & Me!Appendix & ", " & Me!SchdDate & " " & _
"FROM FleetMstr " & _
"LEFT JOIN CoverSheetNos" & _
"ON FleetMstr.FleetID = CoverSheetNos.Fleet" & _
"INNER JOIN AircraftMstr ON FleetMstr.FleetID = AircraftMstr.FleetID" & _
"INNER JOIN DocMstr" & _
"INNER JOIN PartMstr" & _
"ON DocMstr.SchdDocID = PartMstr.SchdDocID" & _
"ON FleetMstr.FleetID = DocMstr.FleetID" & _
"INNER JOIN MxLocMstr" & _
"ON FleetMstr.FleetID = MxLocMstr.FleetID" & _
"WHERE (((PartMstr.FleetID) = " & Me!cbofleet & ") And ((DocMstr.SchdDocID) = " & Me!cboFind & ") And ((CoverSheetNos.CvrSheetID) = " & Me!cboCoverShtNo & ") And ((AircraftMstr.ACID) = " & Me!cboAC & ") And ((MxLocMstr.MxLocID) = " & Me!cboGTWY & "))