Snowflake68
Registered User.
- Local time
- Today, 17:19
- Joined
- May 28, 2014
- Messages
- 464
I am using Application.Echo to turn screen updating off whilst running a delete query on a datasheet subform. I switch the screenupdating back on again after the delete query has ran but the issue I have is when I use the Application.echo False it stops the recordcount displaying on the datasheet after I requery the datasheet.
I know it is the Application.Echo code that is causing the issue because if I comment it out and the run the code then the recordcount displays OK.
I want to use turn the screenupdating off otherwise you temporarily see all the records saying deleted until the requery runs.
Is this a bug in Access? How can I overcome it.
If i manually selecting the form and then press F5 the recordcount is displayed so I added the vba code to set the focus on the form and then refresh it but that doesnt have the same affect as pressing F5.
:banghead::banghead::banghead::banghead:
I know it is the Application.Echo code that is causing the issue because if I comment it out and the run the code then the recordcount displays OK.
I want to use turn the screenupdating off otherwise you temporarily see all the records saying deleted until the requery runs.
Is this a bug in Access? How can I overcome it.
If i manually selecting the form and then press F5 the recordcount is displayed so I added the vba code to set the focus on the form and then refresh it but that doesnt have the same affect as pressing F5.
Code:
Private Sub cmdREMOVE_Click()
On Error GoTo ErrorHandling
Application.Echo False
DoCmd.SetWarnings False
DoCmd.OpenQuery "2cc_ResetItemAdded"
DoCmd.OpenQuery "2c_Delete_SelectionPreviewItem"
DoCmd.RunMacro "ResetGrandTotals"
Me.frmPreviewSelectionDatasheet.Requery
Me!frmPreviewSelectionDatasheet.SetFocus
Me.Refresh ' this line makes no difference but if I press F5 then it displays the recordcount
DoCmd.SetWarnings True
Application.Echo True
ErrorHandling:
Application.Echo True
Exit Sub
End Sub
:banghead::banghead::banghead::banghead: