Im not able to add my records to file...if file is with no records then it adds and after that do not update another records..dont understand why..


here is code:

Private Sub Command2_Click()
Dim coninvoice As Connection
Dim rinvoice As Recordset
Dim cominvoice As Command
Set coninvoice = New Connection
Set cominvoice = New Command
Set rinvoice = New Recordset
With coninvoice
.Provider = "Microsoft.Jet.OLEDB.4.0"
.ConnectionString = "Data Source=D:\MY PROJECTS\CompInvdet.mdb;"
.Open
End With

rinvoice.CursorType = adOpenForwardOnly
rinvoice.LockType = adLockOptimistic
rinvoice.Open "select * from OutInvoices", coninvoice

If rinvoice.EOF = True Then
rinvoice.MoveLast
'rinvoice.AddNew
rinvoice!OutInvoiceNo = Text23.Text
rinvoice!InvIssuedt = Text2.Text
rinvoice!InvIssueTm = Text4.Text
rinvoice!InvRemdt = rinvoice!InvIssuedt
rinvoice!InvRemTm = Text8.Text
rinvoice!ProductName = Text10.Text
rinvoice.Update
MsgBox "added"
Else
MsgBox "notadded"
End If
coninvoice.Close
End Sub

after clicking button...its not adding and going to else part.
pleassseee help