take out the rowsource values of these controls and place the SQL in the tag property of the control.
then on your form_load event add the following
Private Sub Form_Load()
Dim ctrl As Control
For Each ctrl In Me.Controls
Select Case ctrl.Properties("ControlType")
Case acComboBox, acListBox
ctrl.RowSource = ctrl.Tag
Case acSubform
ctrl.Form.RecordSource = ctrl.Form.Tag
Case Else
'do nothing
End Select
Next ctl
Set ctl = Nothing
End Sub
You can also add in to the unload event, the same code above with the rowsource value set to ""
you will notice a dramatic improvement with speed with the above
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.