我收到了“此收藏中未找到的项目”错误 这是我的代码:
Dim rs As DAO.Recordset
Set rs = CurrentDb.OpenRecordset("prodTest")
Dim myName As String
Dim myDate As Date
Dim myType As String
Dim myShift As String
Dim mySupervisor As String
myName = Me.Combo0
myDate = Me.Combo7
myType = Me.Combo10
myShift = Me.Combo14
mySupervisor = Me.Combo18
rs.AddNew
rs("TYPE OF WORK").Value = myType
rs("EMPLOYEE NAME").Value = myName
rs("DATE").Value = myDate
rs("SHIFT").Value = myShift
rs("SHIFT SUPERVISOR").Value = mySupervisor
rs.Update
我可以使用这些字段插入测试表但是当我尝试插入从“获取外部数据”导入的链接表时,它会显示此错误,我不知道什么是错的...
答案 0 :(得分:0)
请尝试下面的代码(在“生产”和“测试”表格中)以检查字段:
Dim iI as Integer
For iI = 0 To (rs.Fields.Count - 1)
Debug.Print rs.Fields(iI).Name
Next
或将名称连接到一个字符串和MsgBox
,或者最适合你的任何名称。
PS:我不是你的组合框控制名称的忠实粉丝,但是没关系......