Weird error while editing recordsets...



I was wondering if anyone knows a solution to this

problem. In my code, I am editing recordsets when

a button is clicked. The data in the recordset is

determined by two text boxes, txtFirstField and

txtSecondField. Every time I click this button,

this code is run:




bkmark = recData.Bookmark

recData.Edit

recData.Fields(0)=txtFirstField.Text

recData.Fields(1)=txtSecondField.Text

recData.Update

recData.MoveFirst

recData.MoveLast

recData.Bookmark = bkmark



The first time I run this, it works fine. The

recordset will be updated just like I wanted.

However, when I run this a second time right after,

I get a "Cursor Not Valid" error and it points to

the recData.Edit line as my error.


Anyone know what I'm doing wrong? I think I have

my recordset declared correctly:


Set recData = dbsData.OpenRecordset(strSQL,

dbOpenDynaset, dbExecDirect, dbOptimistic)




If anyone can help me out, I'd greatly appreciate

it. Thanks...





Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories