Me.组合0.RowSourceType = "表/查询"
Me.组合0.RowSource = "SELECT [21清单文件名称].ID, [21清单文件名称].清单文件名称, [21清单文件名称].清单文件路径, [21清单文件名称].是否选定 FROM 21清单文件名称 WITH OWNERACCESS OPTION;"
Dim rst As DAO.Recordset
Set rst = CurrentDb.OpenRecordset("21清单文件名称", dbOpenTable, dbDenyWrite + dbDenyRead, dbOptimistic) '清单名称
rst.MoveLast
rst.MoveFirst
Dim intI As Integer
For intI = 1 To rst.RecordCount
If rst.Fields("清单文件路径").Value = strA Then
rst.Close
Set rst = Nothing
Me.组合0.Column(0) = DLookup("ID", "21清单文件名称", "[清单文件路径]=" & strA) '?????
Me.组合0.Column(1) = DLookup("清单文件名称", "21清单文件名称", "[清单文件路径]=" & strA) '?????
Me.组合0.Column(2) = strA
Me.组合0.Requery
Exit Sub
End If
rst.MoveNext
intI = intI + 1
Next intI
With rst
.AddNew
![清单文件名称] = Myname
![清单文件路径] = strA
.Update
.Bookmark = .LastModified
Me.组合0 = ![ID]
End With
还是多处使用表[21清单文件名称]的问题
[此贴子已经被作者于2003-7-14 10:25:38编辑过]
|