
Run-time error '424' Object Require
I have create a Customer form and several Navigation control button such
First, Next, Previous and so on. The Navigation control are place on the
same form. During run-time, when I click on the Next command button I get
an error message "run-time error '424', Object Require". Other buttons also
have the same error message.
Here are the codes for loading the database and a partial code for the
Navigation button. Can someone provide a solution for me? Thanks!
Private Sub Form_Load()
Dim OldDB As Database
Dim OldWs As Workspace
Dim newDyn As Recordset
Set OldWs = DBEngine.Workspaces(0)
Set OldDB = OldWs.OpenDatabase("C:\SPTS_DATAs.mdb")
Set newDyn = OldDB.OpenRecordset("Select * from Cust_Info",
dbOpenDynaset)
End Sub
' Navigation button
Private Sub cmdNext_Click()
newDyn.MoveNext
End Sub
Private Sub cmdPrev_Click()
newDyn.MovePrevious
End Sub