I wonder if you can help. I have a button in an access form that produces a mailmerge and launches MS Word. As soon as word is launched, it runs some code to update the merge records and creates a new record in a log table. Basically there is a function called UpdateCommLog that creates a new record with the time stamp etc (in the code sample below).
That all seems to work fine, but if there is a large merge then it can take a while for the process to complete. But if the user Alt-Tabs from the merge document (word) back to Access, it looks like it has crashed (even though it is running the query).
Is there a way I can repaint Access durng the query, so if the user goes to access it doesn't look like it has crashed? I think I may need to use something like 'DoEvents', but I'm not sure where to place it if I do.
Thanks in advance, this would be a real help.
Best regards... Joe.
Dim RS As DAO.Recordset
'//Gets the IDs from the recently selected query
sSQL = "SELECT ID FROM " & strQuery
Set RS = CurrentDb.OpenRecordset(sSQL)
Do While RS.EOF = False
Call UpdateCommLog(RS(0), "Record Merged")
sSQL = "UPDATE DetailsQuery SET LastLog = 'Merged' WHERE ID = " & RS(0)
Set RS = Nothing