I am a novice programmer and I am unfamiliar with the proper terminology.
I have a form with 7 subforms. Two are pivotcharts. I have written code that "refreshes" the form and all subforms as new data is entered. However, it I can see it switching to the first record then back to the current record as it is being requeried.
I am looking for a way to shut off the visual update on the screen until after all the requeries have completed, or advice on how I can improve my code. I have arrived at a solution. It just needs to be improved.
What is the terminology/commands used for turning off the screen updating, then turning it back on?
If I could describe exactly what I was looking for... I would have already found it.
Here is my code:
I have a form with 7 subforms. Two are pivotcharts. I have written code that "refreshes" the form and all subforms as new data is entered. However, it I can see it switching to the first record then back to the current record as it is being requeried.
I am looking for a way to shut off the visual update on the screen until after all the requeries have completed, or advice on how I can improve my code. I have arrived at a solution. It just needs to be improved.
What is the terminology/commands used for turning off the screen updating, then turning it back on?
If I could describe exactly what I was looking for... I would have already found it.
Here is my code:
Code:
Sub ChangeMachineDT()
Dim strLastFocus As String
Dim bm As String ' bookmark
Dim ti As Integer
With Forms.frmMachineDT
If (.mMachine <> "" And .mShift <> "" And .mDate <> "") Then
ti = .ActiveControl.TabIndex
bm = .Bookmark ' store the bookmark
strLastFocus = .ActiveControl.Name
.frmMDTOverviewTbl.Requery
.frmDTEntryCht.Requery
.frmDTEntryChtFrq.Requery
.frmqryMachineDTMinSched.Requery
.frmqryMDTPE1.Requery
.Requery
.Bookmark = bm ' return to the bookmark
DoCmd.GoToControl strLastFocus
End If
End With
End Sub
[code]