|
3#
楼主 |
发表于 2014-12-16 12:25:07
|
只看该作者
Private Sub 查找相片_Click()
Dim j As Integer
Dim rs As ADODB.Recordset
Set rs = New ADODB.Recordset
Dim fileName
rs.Open "表1", CurrentProject.Connection, adOpenKeyset, adLockPessimistic
js = rs.RecordCount
rs.MoveFirst
For j = 1 To rs.RecordCount
fileName = (rs.Fields(1).Value)
Name CurrentProject.Path & "\" & fileName & ".jpg" As CurrentProject.Path & "\" & DLookup("现号", "表1", "原号='" & fileName & "'") & ".jpg"
rs.MoveNext
Next j
rs.Close
Set rs = Nothing
MsgBox "done"
End Sub
应是DLookup("现号", "表1", "原号='" & fileName & "'") & ".jpg"
我写错了,现在又提示文件找不到? |
|