D
DS
I need to select from two table in this SQL statement. How can this be
accomplished?
DoCmd.SetWarnings False
VDSQL = "INSERT INTO tblVoidDetails " & _
"SELECT * FROM tblCheckDetailsTMP " & _
"WHERE tblCheckDetailsTMP.CDCheckID = Forms!frmFXVoidSelect!TxtCheckID " & _
"AND tblCheckDetailsTMP.CDGroupID = Forms!frmFXVoidItem!TxtGroupID " & _
"AND tblCheckDetailsTMP.CDSubGroupID = Forms!frmFXVoidItem!TxtSubGroupID;"
DoCmd.RunSQL (VDSQL)
DoCmd.SetWarnings True
The two Tables are tblCheckDetailsTMP and tblCheckDetails.
Would an Or statement work like this?
DoCmd.SetWarnings False
VDSQL = "INSERT INTO tblVoidDetails " & _
"SELECT * FROM tblCheckDetailsTMP Or tblCheckDetails" & _
"WHERE tblCheckDetailsTMP.CDCheckID = Forms!frmFXVoidSelect!TxtCheckID " & _
"AND tblCheckDetailsTMP.CDGroupID = Forms!frmFXVoidItem!TxtGroupID " & _
"AND tblCheckDetailsTMP.CDSubGroupID = Forms!frmFXVoidItem!TxtSubGroupID;"
DoCmd.RunSQL (VDSQL)
DoCmd.SetWarnings True
Thanks
DS
accomplished?
DoCmd.SetWarnings False
VDSQL = "INSERT INTO tblVoidDetails " & _
"SELECT * FROM tblCheckDetailsTMP " & _
"WHERE tblCheckDetailsTMP.CDCheckID = Forms!frmFXVoidSelect!TxtCheckID " & _
"AND tblCheckDetailsTMP.CDGroupID = Forms!frmFXVoidItem!TxtGroupID " & _
"AND tblCheckDetailsTMP.CDSubGroupID = Forms!frmFXVoidItem!TxtSubGroupID;"
DoCmd.RunSQL (VDSQL)
DoCmd.SetWarnings True
The two Tables are tblCheckDetailsTMP and tblCheckDetails.
Would an Or statement work like this?
DoCmd.SetWarnings False
VDSQL = "INSERT INTO tblVoidDetails " & _
"SELECT * FROM tblCheckDetailsTMP Or tblCheckDetails" & _
"WHERE tblCheckDetailsTMP.CDCheckID = Forms!frmFXVoidSelect!TxtCheckID " & _
"AND tblCheckDetailsTMP.CDGroupID = Forms!frmFXVoidItem!TxtGroupID " & _
"AND tblCheckDetailsTMP.CDSubGroupID = Forms!frmFXVoidItem!TxtSubGroupID;"
DoCmd.RunSQL (VDSQL)
DoCmd.SetWarnings True
Thanks
DS