I recently created two new forms CommunitySMBSubform and CommunityUsersSubform.
As I was writing some VBA code to Requery them I encountered:
Compile Error: Method or data member not found
In troubleshooting the cause, I discovered forms have no class objects and this may be the cause of the error.
Is there anything that can be done to establish their class objects so that they can be referenced by VBA?
TIA.
-------- Code in question below ------------
Private Sub ClearForm_Click()
Dim db As Database
Set db = CurrentDb
Dim Query As String
Dim Query1 As String
Dim Query2 As String
'Clear any selected mailboxes
Query = "Update [Mailbox Status] Set AddToBatchFlag = FALSE Where
AddToBatchFlag = TRUE"
db.Execute Query
' Requery the SMB Subform
Query1 = "Select * from CommunitySMB"
db.Execute Query1
Me.CommunitySMBSubform.Requery <= Compile Error: Method or data member not found occurs here
'Requery the Users Subform
Query2 = "Select * from CommunityUser"
db.Execute Query2
Me.CommunityUsersSubform.Requery
RefreshBatchStats_Click
End Sub