Welcome to Dream.In.Code
Getting VB Help is Easy!

Join 136,562 VB Programmers for FREE! Get instant access to thousands of VB experts, tutorials, code snippets, and more! There are 1,903 people online right now. Registration is fast and FREE... Join Now!




No Current Record

 
Reply to this topicStart new topic

No Current Record, Run Time Error 3021

Hybrid SyntaX
11 May, 2008 - 01:12 PM
Post #1

New D.I.C Head
*

Joined: 10 May, 2008
Posts: 15



Thanked: 1 times
My Contributions
hi
i can't delete my first and my last record what should i do ?
it gives Run Time error 3021 "No current record"
and when i click on debug it point me to " MyRS.Delete "
i usually open a 13-field table
vb

Private Sub cmdDelete_Click()

MyRS.Delete
MyRS.MoveNext
Call Reload
End Sub



also sometimes (usually when i wanna move between records) it points me to " txt(i).Text = MyRS(i) & "" "
and this is Sub Reload

vb

Public Sub Reload()
On Error GoTo 1
For i = 0 To MyRS.Fields.Count - 1
txt(i).Text = MyRS(i) & ""
Next i
TPrice.Text = txt(9).Text

1:
If Err.Number = 3021 Then
Exit Sub
End If
End Sub


and variables
vb

Dim MyDB As Database
Dim MyRS As Recordset

User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 12/2/08 11:42PM

Live VB Help!

VB Tutorials

Reference Sheets

VB Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month