Is there any way to hold the execution of a portion of your procedure for a few seconds? What my procedure does is to insert a new record into an Access table and then refresh the data grid. Unfortunately, the data grid is not refreshing because I noticed that it starts refreshing even before the record is added to the Access table. I was hoping to insert a line in my procedure asking it to wait for a few seconds before refreshing the data grid.
Below is an example of my procedure:
Dim dbs As ADODB.Connection
Set dbs = New ADODB.Connection
dbs.ConnectionString = "Provider=MSDASQL.1;Data Source=ABC"
dbs.Open
dbs.Execute "INSERT INTO Temp_Table (Temp_Field) VALUES (1);"
dbs.Close
Set dbs = Nothing
queryAccess = "Select * from Temp_Table"
If DataEnviron.rsBrw_Access.State = 1 Then
DataEnviron.rsBrw_Access.Close
End If
DataEnviron.Commands("Brw_Access").CommandText = queryAccess
DataEnviron.Commands("Brw_Access").Execute
Set dtg_Access.DataSource = DataEnviron
dtg_Access.DataMember = "Brw_Access"
dtg_Access.Refresh