Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 21251

database

$
0
0
guys i need recommendation or ideas why im having "obj req" error
this code is used for moving records from one another

Code:

Private Sub Command5_Click()

'first button, disable first and previous
Data1.Recordset.MoveFirst
cmdprevious.Enabled = False
cmdfirst.Enabled = False
cmdnext.Enabled = True
cmdlast.Enabled = True

End Sub

Private Sub Command6_Click()

'previous button
Data1.Recordset.MovePrevious
cmdnext.Enabled = True
cmdlast.Enabled = True
If Data1.Recordset.BOF = True Then
cmdprevious.Enabled = False
cmdfirst.Enabled = False
Data1.Recordset.MoveFirst
End If

End Sub

Private Sub Command7_Click()

'next button
Data1.Recordset.MoveNext
cmdfirst.Enabled = True
cmdprevious.Enabled = True
If Data1.Recordset.EOF = True Then
cmdlast.Enabled = False
cmdnext.Enabled = False
Data1.Recordset.MoveLast
End If

End Sub

Private Sub Command8_Click()

'last button, disable next and last
Data1.Recordset.MoveLast
cmdprevious.Enabled = True
cmdfirst.Enabled = True
cmdnext.Enabled = False
cmdlast.Enabled = False

End Sub

there i copied this code from a book so i was surprised when i had the error

remember if you had a suggestion keep it simple :)

Viewing all articles
Browse latest Browse all 21251

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>