find and match record in VbA

hai.., i newbie in vba, i want to try find which one txt file i alread

Page 1 of 1

0 Replies - 412 Views - Last Post: 05 August 2009 - 09:21 PM Rate Topic: -----

#1 wat  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 24-May 09

find and match record in VbA

Posted 05 August 2009 - 09:21 PM

Dim oFSystem As Object
Dim oFolder As Object
Dim oFile As Object
Dim sFolderPath As String
Dim SQL As String
Dim i As Integer
Dim var_FileCN As String
Dim sFile As String
Dim var_FilePattern As String

Set dbs = CurrentDb()
Set obj_RSCN = New ADODB.Recordset

sFolderPath = "D:\Tmp\DATAIN\"

Set oFSystem = CreateObject("Scripting.FileSystemObject")
Set oFolder = oFSystem.GetFolder(sFolderPath)

Set obj_RSCN = dbs.OpenRecordset("SELECT File From specificfile", dbOpenDynaset)
MsgBox obj_RSCN!File
For Each oFile In oFolder.Files
If Not obj_RSCN.EOF Then
If obj_RSCN!File > oFile Then
sFile = Mid(oFile, 16, 30)
obj_RSCN.AddNew
obj_RSCN!File = sFile
obj_RSCN.Update
obj_RSCN.MoveNext
Else
If oFile > obj_RSCN!File = True Then
' obj_RSCN.MoveNext
'MsgBox i & " files were imported."
End If
End If
End If
Next

Is This A Good Question/Topic? 0
  • +

Page 1 of 1