speakers_86
Registered User.
- Local time
- Today, 11:31
- Joined
- May 17, 2007
- Messages
- 1,919
This routine can be run in a form's after update event. It scans all open forms, and one subform for combo boxes and refreshes them. It can be expanded to refresh other control types or more subforms, but I don't have the need, so have at it!
Code:
Public Sub RefreshCombos()
Dim frm As Form
Dim ctl As Access.control
Dim ctl2 As Access.control
For Each frm In Application.Forms
If CurrentProject.AllForms(frm.Name).IsLoaded Then
For Each ctl In frm
If ctl.ControlType = acComboBox Then
ctl.Requery
Else
If ctl.ControlType = acSubform Then
For Each ctl2 In ctl.Form
If ctl2.ControlType = acComboBox Then ctl2.Requery
Next
End If
End If
Next ctl
End If
Next frm
End Sub