can some help with this problem in VB6?
why when i kip pressing next there i and error this is the code plz help me
Option Explicit
Dim DB As Database
Dim RS As Recordset
Private Sub Command4_Click()
End
End Sub
Private Sub cmdadd_Click()
cmdsave.Visible = True
cmdcancel.Visible = True
cmdadd.Visible = False
cmdprev.Visible = False
cmdnext.Visible = False
cmdexit.Visible = False
cmdfirst.Visible = False
cmdlast.Visible = False
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
End Sub
Private Sub cmdcancel_Click()
cmdsave.Visible = False
cmdcancel.Visible = False
cmdadd.Visible = True
cmdprev.Visible = True
cmdnext.Visible = True
cmdexit.Visible = True
cmdfirst.Visible = True
cmdlast.Visible = True
Dim DB As Database
Dim RS As Recordset
Set DB = OpenDatabase(App.Path & "/db1.mdb")
Set RS = DB.OpenRecordset("STUD_INFO")
Text1.Text = RS!Name
Text2.Text = RS!Course
Text3.Text = RS!Address
End Sub
Private Sub cmdexit_Click()
End
End Sub
Private Sub cmdfirst_Click()
RS.MoveFirst
Text1.Text = RS!Name
Text2.Text = RS!Course
Text3.Text = RS!Address
End Sub
Private Sub cmdlast_Click()
RS.MoveLast
Text1.Text = RS!Name
Text2.Text = RS!Course
Text3.Text = RS!Address
End Sub
Private Sub cmdnext_Click()
RS.MoveNext
Text1.Text = RS!Name
Text2.Text = RS!Course
Text3.Text = RS!Address
End Sub
Private Sub cmdprev_Click()
RS.MovePrevious
Text1.Text = RS!Name
Text2.Text = RS!Course
Text3.Text = RS!Address
End Sub
Private Sub cmdsave_Click()
Dim DB As Database
Dim RS As Recordset
Set DB = OpenDatabase(App.Path & "/db1.mdb")
Set RS = DB.OpenRecordset("STUD_INFO")
RS.AddNew
RS!Name = Text1.Text
RS!Course = Text2.Text
RS!Address = Text3.Text
RS.Update
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
MsgBox "DATA SAVED", vbOKOnly, "app Message"
End Sub
Private Sub Form_Load()
cmdsave.Visible = False
cmdcancel.Visible = False
Set DB = OpenDatabase(App.Path & "/db1.mdb")
Set RS = DB.OpenRecordset("STUD_INFO")
Text1.Text = RS!Name
Text2.Text = RS!Course
Text3.Text = RS!Address
End Sub
--------------------------------------...
some code is still missing i don't know who i can fix it,,,,
i need when i press next and go to the last list it go again in the first list tnx
Tags: