Changing focus or manually refresh a form will update the data displaying on a form. How can I have it auto-update when the database is change like a chat room?
Thank you.
Sub RefreshForm(frmForm As Form)
10 On Error GoTo xxx
Dim x As Integer
20 With frmForm
30 For x = 0 To .Controls.Count - 1
40 Select Case .Controls(x).ControlType
Case acComboBox, acListBox, acSubform
50 .Controls(x).Requery
60 End Select
70 Next
80 .Refresh
90 End With
xx:
100 Exit Sub
xxx:
110 If err.Number = 2478 Then
120 Resume Next
130 Else
140 Call ErrorLog(err, Error$, err.Source, "Sub: RefreshForm", Erl)
150 Resume xx
160 End If
End Sub
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.