Hi All..
I am trying to access records and edit and save the changes .. Here is the code
Private Sub cmd_edit_Click()
Dim addnew As Boolean
rsnew3.Open "select * from company", c, adOpenDynamic, adLockOptimistic
rsnew3.addnew
If text1.Text = "" Then
MsgBox " enter the company name"
text1.SetFocus
rsnew3.Fields("text1").Value = text1.Text
End If
If text2.Text = "" Then
MsgBox " enter the company address"
text2.SetFocus
rsnew3.Fields("text2").Value = text2.Text
End If
rsnew3.Update
rsnew3.Close
MsgBox " add new successful ", vbInformation, "successful"
End Sub
Private Sub Form_Load()
Dim cs As String
c.Open ("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\COMION.MDB;Persist Security Info=False")
rsnew2.Open "select * from company", c, adOpenDynamic
Me.text1.Text = rsnew2(2)
Me.text2.Text = rsnew2(3)
End Sub
I am getting message that "add new successful" but records are not actually updated...
What should i do ..? can any1 help me pls???