Invalid Argument - Error 3001 (2 Viewers)

T

tdb

Guest
This is my first post so I hope I'm in the right place.

I am receiving an Invalid Argument error on a rst.Update Instruction. The help refers to a argument in a DLL but does not specify what DLL it is. I uninstalled/reinstalled Access but no good.
Sample (paraphrased) Code:
Public Sub update
Dim db As Database
Dim rst As RecordSet
Set db=Currentdb
Set rst = db.OpenRecordSet("qry-date")
rst.MoveLast
rst.MoveFirst
Do Until rst.EOF
(instruction)
rst.Edit
(instruction to update rst --rst!field = ws)
rst.Update
rst.MoveNext
Loop
rst.Close
End Sub
I am updating a field in the recordset based upon other fields in same recordset. The table contains approx. 500,000 rows. When this happens it corrupts the db and I either have to repair or copy to a new db. If more information is required I'll try to supply it.

Any help would be appreciated.
Thanks
T Booth
 

Robin

Registered User.
Local time
Today, 13:20
Joined
Sep 26, 2000
Messages
19
Hi,

This worked fine for me.
Public Function UpdateNames()

On Error GoTo UpdateNames_Err


Dim db As Database
Dim rs As Recordset
Dim ct As String

Set db = CurrentDb()
Set rs = db.OpenRecordset("Query1", DB_OPEN_DYNASET)

rs.MoveLast
rs.MoveFirst
While Not rs.EOF
If rs("fldName") = "Bruce" Then
rs.Edit
rs("fldOtherName") = "Brenda"
rs.Update
End If
rs.MoveNext
Wend

Exit Function

UpdateNames_Err:
MsgBox Error$, 16, "Error"
Exit Function
End Function

But I realy think you should use the find first find next method when you are dealing with 500,000 records. If you need help with this my e-mail address is Robin@falconer.mtx.net

Regards
Robin
 

Users who are viewing this thread

Top Bottom