Originally Posted by
EddieN1
I'm running Access 2007 and SQL Server 2008 R2. I have a simple, datasheet view form in which I want to populate a number of fields based on the entry of one field. In the AfterChange event, I do a Me.Refresh, then I call an ADO subroutine. The subroutine first gets the values to use to populate the other fields, then gets the row to be updated. I use a simple "SELECT * FROM tbl_Data WHERE DetialID = intDetailID". (The calling function passes the detail ID to the subroutine.) Then I update the row as desired. This works perfectly if the row was previously created. However, if I'm inserting a new row, the SELECT statement returns with rsData.EOF as true. If I put in a delay of 4-5 seconds, it usually finds and updates the row. It's like control continues after the Refresh without waiting for the Refresh to finish. I always thought Access was synchronous like this, but I'm beginning to wonder. Any suggestions as to how I can ensure the Refresh has finished before going on? Thanks, Eddie