Last Record overwritten using .AddNew

J

jeffrey.bergstedt

I am sending information from and Excel Spreadsheet to Access 2003. The
connection is fine, the recordset opens fine. When there are no rows in
the table, the scripting fails stating Either EOF or BOF is true or a
current record is required.

When there are records in the table and I run the script in Excel, the
last record in the table gets over-written. I can not figure out what I
am doing wrong. Here is the script that deals with the .Addnew.

Can anyone tell me how to fix this problem?

With rs

.Fields("PON").Value = PON
.Fields("TN").Value = TN
.Fields("Last Name").Value = LstNme
.Fields("First Name").Value = FstNme
.Fields("Lineage").Value = Lineage
.Fields("Title").Value = Title1
.Fields("Street Number").Value = StNum
.Fields("Street Directional").Value = StDir
.Fields("Street Name").Value = StName
.Fields("Street Thoroughfare").Value = StThr
.Fields("City").Value = City
.Fields("State").Value = State
.Fields("ZipCode").Value = ZpCd
.Fields("Error Date").Value = ErrDte
.Fields("Error Description").Value = ErrDesc
.AddNew

End With

Shouldn't this cause the record being worked on to be inserted AFTER
the last record or as the first record if the table is empty???

Jeff
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top