Richie
06-16-2003, 11:15 PM
Hi,
How do you check that tblTempTable does not have same record as my tblTable1 before tblTempTable can be appended. If a criteria is required, how do you write it? TblTempTable is in Dbase2.mdb while tblTable1 is in Dbase1.mdb. Below is my code which I hope someone can correct or alter.
Many Thanks.
Private Sub btnAppend_Click()
On Error GoTo Err_btnAppend_Click
strSql = "INSERT INTO tblTempTable(TicketNo,FerryName,[FDate] IN 'C:\Dbase2.mdb' " & _
"SELECT tblTable1.TicketNo,tblTable1.FerryName,tblTable1.F Date FROM tblTable1 ;"
DoCmd.SetWarnings False
DoCmd.RunSQL strSql
DoCmd.SetWarnings True
'Debug.Print strSql
Exit_btnAppend_Click:
On Error Resume Next
Set db = Nothing
Set ws = Nothing
Exit Sub
Err_btnAppend_Click:
MsgBox Err.Description
Resume Exit_btnAppend_Click
End Sub
How do you check that tblTempTable does not have same record as my tblTable1 before tblTempTable can be appended. If a criteria is required, how do you write it? TblTempTable is in Dbase2.mdb while tblTable1 is in Dbase1.mdb. Below is my code which I hope someone can correct or alter.
Many Thanks.
Private Sub btnAppend_Click()
On Error GoTo Err_btnAppend_Click
strSql = "INSERT INTO tblTempTable(TicketNo,FerryName,[FDate] IN 'C:\Dbase2.mdb' " & _
"SELECT tblTable1.TicketNo,tblTable1.FerryName,tblTable1.F Date FROM tblTable1 ;"
DoCmd.SetWarnings False
DoCmd.RunSQL strSql
DoCmd.SetWarnings True
'Debug.Print strSql
Exit_btnAppend_Click:
On Error Resume Next
Set db = Nothing
Set ws = Nothing
Exit Sub
Err_btnAppend_Click:
MsgBox Err.Description
Resume Exit_btnAppend_Click
End Sub