I am having a continuing problem with Recordsets. I use them to add new records (.AddNew/.Update) and if I step through the code, everything works fine. If I run the code normally, there a numerous times (inconsistently) where my table will not have any of the added records. It seems like I can "avoid" this problem by adding a messagebox before closing, but I don't want the user to have a prompt and have to hit "OK" every time I've added records from a recordset. I'd truly appreciate any thoughts, ideas, etc. that I can try as I think I've tried a bunch (adding doevents, sleeps, moving first/last before closing, etc.) all with mixed results. Here is an example of some code:
Set rsSimilarTable = dbCurrent.OpenRecordset("SELECT * FROM [tbl tblName]", dbOpenDynaset, dbSeeChanges)
While Not (rs.EOF)
!SalesOrderNumber = rs!SalesOrderNumber
!CustomerNumber = rs!CustomerNumber
!PurchaseOrder = rs!PurchaseOrder
!OrderDate = rs!OrderDate
!Value = rs![Value]
set rsSimilarTable = Nothing
' Exit from function/procedure and looking to use the table
Thanks for your help and input.
Red Flag Submitted
Thank you for helping keep Tek-Tips Forums free from inappropriate posts. The Tek-Tips staff will check this out and take appropriate action.
Reply To This Thread
Posting in the Tek-Tips forums is a member-only feature.