Junior1544
Technical User
Here is some code i'm tring to get working...
I can't seem to get the findfirst to work right...
I've checked my vba references... and DAO 3.6 is checked...
ok, here's my module...
Thanks for taking a look at this...
--James
Sub work(File_Name As String)
On Err GoTo errorhandler
DoCmd.SetWarnings False
DoCmd.RunSQL "DELETE Table1.* FROM Table1;"
DoCmd.SetWarnings True
DoCmd.TransferText acImportDelim, "ImportSpec", "table1", File_Name
Dim rst As DAO.Recordset
Dim strcriteria As String
Set rst = CurrentDb().OpenRecordset("table1"
rst.MoveLast
rst.MoveFirst
strcriteria = "F2 = 'tfc002'"
rst.FindFirst (strcriteria)
rst.MoveNext
rst.MoveNext
rst.MoveNext
rst.MoveNext
Debug.Print rst!f5
rst.Close
Set rst = Nothing
Exit Sub
errorhandler:
MsgBox Err.Number & " " & Err.Description
rst.Close
Set rst = Nothing
End Sub junior1544@jmjpc.net
Life is change. To deny change is to deny life.
I can't seem to get the findfirst to work right...
I've checked my vba references... and DAO 3.6 is checked...
ok, here's my module...
Thanks for taking a look at this...
--James
Sub work(File_Name As String)
On Err GoTo errorhandler
DoCmd.SetWarnings False
DoCmd.RunSQL "DELETE Table1.* FROM Table1;"
DoCmd.SetWarnings True
DoCmd.TransferText acImportDelim, "ImportSpec", "table1", File_Name
Dim rst As DAO.Recordset
Dim strcriteria As String
Set rst = CurrentDb().OpenRecordset("table1"
rst.MoveLast
rst.MoveFirst
strcriteria = "F2 = 'tfc002'"
rst.FindFirst (strcriteria)
rst.MoveNext
rst.MoveNext
rst.MoveNext
rst.MoveNext
Debug.Print rst!f5
rst.Close
Set rst = Nothing
Exit Sub
errorhandler:
MsgBox Err.Number & " " & Err.Description
rst.Close
Set rst = Nothing
End Sub junior1544@jmjpc.net
Life is change. To deny change is to deny life.