I have a form with a subform. The user selects a button on the form to cause data to be transferred from another database to the current database. The data transfer is divided into sections based on certain criteria. The subform is used to show the progress of the transfer. Each time a section of the data is successfully transferred, fields on the subform are updated to reflect the progress. The problem is that the progress data that the user sees is not upated until the transfer of the data for all sections has been completed. I have used breakpoints to confirm that the code used to update the progress is actually executed when expected.
What code can I use to force the displayed subform data to update when each section is updated as opposed to being queued until after the entire transfer for all sections has completed?
Below is the code used to update the transfer progress.
Joe
What code can I use to force the displayed subform data to update when each section is updated as opposed to being queued until after the entire transfer for all sections has completed?
Below is the code used to update the transfer progress.
Code:
rstCurrent.MoveFirst ' go to first record in table
Do While True ' Loop through the whole list of Baselines, Elements and Programs of Interest
If rstCurrent.EOF Then
'MsgBox "End of the list of Baselines, Elements and Programs of Interest!"
Exit Do
Else
myBaseline = rstCurrent!Baseline
myElement = rstCurrent!Element
myProgram = rstCurrent!Program
strBaselineElementProgram = rstCurrent!Baseline & "-" & rstCurrent!Element & "-" & rstCurrent!Program
'Record the time that the download began
rstCurrent.Edit
rstCurrent!DownloadStartTime = Now()
rstCurrent.Update
strDownloadStartTime = PutDownloadStartTime(rstCurrent!DownloadStartTime)
PutCurrentBaseElemProg (strBaselineElementProgram)
strDownloadCompletedTime = "" ' Blank out the completed Time
Forms!frm_Start_the_Database!frmDownloadProgress!txtCurrentBaseElemProg.Value = strBaselineElementProgram
Forms!frm_Start_the_Database!frmDownloadProgress!txtDownloadStartTime.Value = strDownloadStartTime
Forms!frm_Start_the_Database!frmDownloadProgress!txtDownloadCompletedTime.Value = strDownloadCompletedTime
Forms!frm_Start_the_Database!frmDownloadProgress!txtRemainingCombos.Value = longRemainingRecordsToProcess
Forms!frm_Start_the_Database!frmDownloadProgress.Requery
'MsgBox "A new baseline/element/program combination is being processed."
strStatus = GetAIMSData(myBaseline, myElement, myProgram)
'Check for an error in the transfer
If strStatus = GetTransferFailed Then
Resume Err_GetAIMSDataForBaselinesOfInterest
End If
'Record the time that the download completed
rstCurrent.Edit
rstCurrent!DownloadCompletedTime = Now()
rstCurrent.Update
strDownloadCompletedTime = PutDownloadCompletedTime(rstCurrent!DownloadCompletedTime)
PutCurrentBaseElemProg (strBaselineElementProgram)
Forms!frm_Start_the_Database!frmDownloadProgress!txtCurrentBaseElemProg.Value = strBaselineElementProgram
Forms!frm_Start_the_Database!frmDownloadProgress!txtDownloadStartTime.Value = strDownloadStartTime
Forms!frm_Start_the_Database!frmDownloadProgress!txtDownloadCompletedTime.Value = strDownloadCompletedTime
longRemainingRecordsToProcess = longRemainingRecordsToProcess - 1
Forms!frm_Start_the_Database!frmDownloadProgress!txtRemainingCombos.Value = longRemainingRecordsToProcess
Forms!frm_Start_the_Database!frmDownloadProgress.Requery
'MsgBox "The new baseline/element/program combination was processed."
rstCurrent.MoveNext
End If
Loop