Unable to disable screen updates
Hi,
I have a new button that needs to run several tasks automaticaly to assist our clients and speed up switching on forms. As such i have made some adjustements to the process, the process works perfectly HOWEVER I am trying to prevent the user seeing the current form being closed another form being made visible from invisible, that form being updated to a new record, that form being made invisible and finaly another form opening up.
I have tried all 3 methods i could find for disabling screen updating, however every single time I run this process I can see all the steps being run through as if the code to disable the echo's wasn't even there.
Any thoughts or help would be apriciated.
Code:
If FilterFromCheckout = True Then
On Error Resume Next
Forms("frmMain").Painting = False
Forms("Checkout").Painting = False
Me.Painting = False
On Error GoTo 0
Application.Echo False
DoCmd.Echo False
Forms("Checkout").Command34_Click
End If
Dim myrs As New ADODB.Recordset
myrs.Open "SELECT LargeData from settings", CurrentProject.Connection, adOpenKeyset, adLockReadOnly
If myrs("LargeData") = False Then
If Not IsNull(Me.PatList.Value) Then
searchstring = Me.PatList.Value
DoCmd.Close acForm, "Search"
On Error Resume Next
Forms("frmMain").MedicalID.SetFocus
DoCmd.FindRecord searchstring, acEntire, , acSearchAll, , acCurrent
Forms("BatchPayment").LocatePatient searchstring
On Error GoTo 0
End If
Else
Forms("frmMain").RecordSource = "SELECT * FROM tblPatient WHERE [MedicalID#] = '" & Me.PatList.Value & "'"
DoCmd.Close acForm, "Search"
'Forms("frmMain").Requery
End If
myrs.Close
Set myrs = Nothing
If FilterFromCheckout = True Then
Forms("frmMain").EPMSwitch_Click
DoCmd.Echo True
Application.Echo True
On Error Resume Next
Forms("frmMain").Painting = True
Forms("Checkout").Painting = True
Me.Painting = True
On Error GoTo 0
End If