Tony兄给我做的编码,运行很好,我只是改了一下要去的表(由bcroutingstagestracking变为FGITacking),这段代码不工作,请大侠帮助看看,哪里有错?谢谢!
Private Sub ToFGI_Click()
DoCmd.SetWarnings False
If ToFGI = 0 Then
DoCmd.RunSQL "delete from FGITracking where sn=" & Sn
Else
DoCmd.RunSQL "insert into FGITracking (sn) values ('" & Sn & "')"
End If
DoCmd.SetWarnings True
End Sub
your err sql sql code:
look this:
insert into tablename select * from tablename where columnsname = "exp"
or
insert into tablename(columns1,columns2)
select col1,col2 from tablename where col1 = "exp"
------------------------------------------------------
columns1 <->col1,columns2<->col2....
Hi, Brother HG
Can you give me the detail about your code? I want the sn of the wodetailtracking table auto to the same field of the fgitracking table. Thanks a lot! I don't know how to use sql code.