|
-
Apr 22nd, 2002, 07:51 PM
#1
Thread Starter
Lively Member
Simple movenext problem
I'm sure there's a simple answerto this problem, but I cant figure it out. I'm just trying to move to the next current record in my database, but instead, this code just moves to the 2nd record and then does nothing, no matter how many times I click on the movenext button. I read another post somewhere that I'm probably opening the database each time I click the button and it just moves to the 2nd record.
Can anyone help me with this problem please?
VB Code:
Set dbsNorthwind = OpenDatabase("C:\Program Files\DevStudio\VB\ZTest5.mdb")
Set rstEmployees = dbsNorthwind.OpenRecordset("Players", dbOpenDynaset)
strSQL = "SELECT * FROM Players "
'dbsNorthwind.Execute strSQL
With rstEmployees
.MoveNext
End With
lblName.Caption = rstEmployees.Fields("PlayerName").Value
Thanks,
-
Apr 22nd, 2002, 08:21 PM
#2
PowerPoster
It seems you are!
I would separate the code put this part:
VB Code:
Set dbsNorthwind = OpenDatabase("C:\Program Files\DevStudio\VB\ZTest5.mdb")
Set rstEmployees = dbsNorthwind.OpenRecordset("Players", dbOpenDynaset)
strSQL = "SELECT * FROM Players "
'dbsNorthwind.Execute strSQL
On form_load event
And the rest on the movenext button or something!
later
b
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|