Requery all controls?

agehoops

Registered User.
Local time
Today, 20:29
Joined
Feb 11, 2006
Messages
351
Is there a way to requery all the controls or types of controls? I've tried doing a form.requery and others, but the only one that works is the specify the control each time, which sucks,cos i'd have to do it for 366 controls which I don't really want to do.

Thanks
 
Try something like:

Code:
  Dim ctl As Control

  For Each ctl In Me.Controls 
    Select Case ctl.ControlType
      Case acComboBox
        ctl.Requery
    End Select
  Next ctl

Of course, I'd be remiss in not questioning a form with 366 controls on it. ;)
 
Ah fantastic, works a treat cheers.

haha thought you might. Basically I'm creating a custom event calendar which obviously will contain 365 days and 1 leap year so the 366 days, as I've done it as a tabbed calendar rather than selection the month by a drop down
 

Users who are viewing this thread

Back
Top Bottom