469,357 Members | 1,592 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,357 developers. It's quick & easy.

Want to update only one field (rs3!a_votes)... it is giving runtime error '3021'

rs3.Move (Index)
rs3!a_Votes = Val(Text2(Index).Text) + 1
rs3.Update


here index is working... dont bother about that...

but this is not working.. can any one edit this code????
it is giving "either bof or eof is true"

help me...
Dec 24 '11 #1
1 1296
Killer42
8,435 Expert 8TB
Kind of a tough one, given the available info so far. But I'm going to take a stab at it.

I believe the relevant point here is that error 3021 indicates that the recordset does not have a current record. So really, the only possibilities I can see here are that either there are no records, or your Move has gone "out of bounds".

I'd say the chances are that despite your assurances to the contrary, your index value isn't as right as you think. Remember that many indexes in VB are (very annoyingly, in my opinion) zero-based. So for example, in a listbox with 5 entries, they are not numbered 1 to 5. They are numbered 0 to 4. This very frequently trips people up.

Oh, by the way - what version of VB is this? And what type of recordset (could be ADO, DAO, not sure whether there are others by now).
Dec 27 '11 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

1 post views Thread by gagonm | last post: by
1 post views Thread by Marylou17 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.