2个表的复制,表字段不同,我写了代码,现在告诉我类型不匹配请问这是为什么
Dim db As Databases
Dim sql As String
Dim rs As Recordset
Dim db1 As Databases
Dim sql1 As String
Dim rs1 As Recordset
Set db = CurrentDb()
sql = "SELECT * FROM 资产 "
Set rs = rs.OpenRecordset(sql, dbOpenDynaset)
Set db1 = CurrentDb()
sql1 = "SELECT * FROM 产品 "
Set rs1 = rs1.OpenRecordset(sql, dbOpenDynaset)
If Me.类别.Value = "资产" Then
rs1.AddNew
rs1.Fields("产品名称") = rs.Fields("设备名称")
rs1.Fields("产品编号") = rs.Fields("设备编号")
rs1.Fields("产品型号") = rs.Fields("设备型号")
rs1.Fields("参考价格") = rs.Fields("设备原值")
rs1.Fields("启用时间") = rs.Fields("启用时间")
rs1.Fields("沧暗氐?quot;) = rs.Fields("安装地点")
rs1.Fields("产品性质") = rs.Fields("资产性质")
rs1.Fields("类别") = rs.Fields("类别")
rs1.Fields("所属部门") = rs.Fields("所属部门")
rs1.Fields("保修年限") = rs.Fields("保修年限")
rs1.Fields("资产所属部门") = rs.Fields("资产所属部门")
rs1.Update
rs.Update
End If
[此贴子已经被作者于2006-9-26 16:25:37编辑过]
|