Hi All..
I am accessing 2 colums from access database and updating them .


Option Explicit
Dim c As New adodb.Connection
Dim cn As New adodb.Connection
Dim cm As adodb.Command
Dim rsnew2 As New adodb.Recordset

Private Sub cmd_edit_Click()

If text1.Text = "" Then
MsgBox " enter the company name"
text1.SetFocus
rsnew2.Fields("text1") = text1.Text
End If
If text2.Text = "" Then
MsgBox " enter the company address"
text2.SetFocus
rsnew2.Fields("text2") = text2.Text
End If
rsnew2.Update
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


There is error in RSNEW2.UPDATE ..
CAN ANYBODY HELP ME TO SOLVE MY PROBLEM ??????????