Requery a form to show lastest changes

E

EC774

Hi, I have not been able to get the form I am working on to show the latest
changes the users have input. I have a linked Inbox table from Outlook
feeding a query that compares the Inbox table against a second table that is
not linked. As the user inputs data through the form into the second table
the number of outstanding records in the query should be listing fewer
records every time the user adds a new record to the second table.

What is happening is sometimes the first new record added will be subtracted
from the list but after that then the records do not advance to the next
record and I just end up making duplicate records in the second table.
Below is the code that I am using. The office version is 2003 with all
patches and updates. I am not very experienced at programming and most of the
code is from books. If anyone could please help show what I am not doing
right I will greatly appreciate it and thank-you.


Private Sub Command17_Click()
Dim rst As Recordset
Set rst = CurrentDb.OpenRecordset("Sent")
If Text13 <> "" Then
rst.Index = ID
rst.AddNew
rst!CustomerID = CustomerID
rst!To = EmailAddress
rst!Contents = Contents
rst!Reply = Me.Text13
rst!Received = Received
rst.Update
rst.Bookmark = rst.LastModified
rst.MoveNext
'remeber the left side of the "=" is the sent table.

DoCmd.Requery update_list
'DoCmd.GoToRecord , , acNext

Exit Sub
Else
MsgBox "Please check that the Reply field is not empty. Once the Reply
field has been filled out please try again."
End If
 
Top