Is something like this what you're looking for? Dim frm As AccessObject 'Temporary form Dim fSuccess As Boolean 'Have we been successful? 'Initialize fSuccess = True For Each frm In CurrentProject.AllForms fSuccess = fSuccess And FormSetBackgroundColor(frmName:=frm.Name) Next frm
In FormSetBackgroundColor() you can loop through the Controls collection to find labels. I don't think there is a Sections collection, but there are indexes for each standard section type (Form Header, Page Header, Detail, etc.).
In you can dimension frm as Access.Form: Dim frm As Access.Form 'Form we're processing 'Open the form in design mode so we can access control properties DoCmd.OpenForm FormName:=frmName, View:=acDesign Set frm = Forms(frmName)
"BrianDP" <bdp222[ at ]gmail.com> wrote in message news:bf10ac33-2551-4523-8189-05fec1bf1954[ at ]a26g2000prf.googlegroups.com...
[Quoted Text] >I think that sums it up. If someone can help me, TIA. > > Just to clarify- I have several forms- and I want to run a program > that will look at each one, and on each form, if the type of object is > a Header, Form, Footer, or Label, change it's background to a given > color. > > Something like For each object in objects...? The syntax excapes me > at the moment. > > -BrianDP
|