G
Guest
I have to write a code where I have 2 tables table 1 and table 2 which are
similar structures. I got to insert only those records which are not found
based on a key field called rec_isn
So I am trying to do something like this in access forms coding.. but it
dosent work... plz help...
Gives me type mismatch on set rs = "select ..."
Private Sub CmdImpDB_Click()
Dim SQL As String
Dim rs As Recordset
Dim rs1 As Recordset
Set rs1 = "select * from tbl_wc_wcands_kpwcmatch"
Do While rs1.EOF = False
SQL = rs1!REC_ISN
Set rs = "select * from kpwcmaster,tbl_wc_wcands_kpwcmatch where
rec_isn = '" & SQL & "'"
If rs.EOF Then
DoCmd.RunSQL "insert into kpwcmaster select * from
tbl_wc_wcands_kpwcmatch where rec_isn='" & SQL & "'"
End If
rs1.MoveNext
Loop
End Sub
Thanks
Madhuri
similar structures. I got to insert only those records which are not found
based on a key field called rec_isn
So I am trying to do something like this in access forms coding.. but it
dosent work... plz help...
Gives me type mismatch on set rs = "select ..."
Private Sub CmdImpDB_Click()
Dim SQL As String
Dim rs As Recordset
Dim rs1 As Recordset
Set rs1 = "select * from tbl_wc_wcands_kpwcmatch"
Do While rs1.EOF = False
SQL = rs1!REC_ISN
Set rs = "select * from kpwcmaster,tbl_wc_wcands_kpwcmatch where
rec_isn = '" & SQL & "'"
If rs.EOF Then
DoCmd.RunSQL "insert into kpwcmaster select * from
tbl_wc_wcands_kpwcmatch where rec_isn='" & SQL & "'"
End If
rs1.MoveNext
Loop
End Sub
Thanks
Madhuri