T
Tony Williams
I'm trying to change the backcolour of all my forms and am using this code
in a module
Public Sub ChangeAllControlProps()
Dim dbCur As Database
Dim doc As Document
On Error GoTo ErrHandler
Set dbCur = CurrentDb
For Each doc In dbCur.Containers("Forms").Documents
DoCmd.OpenForm doc.Name, acDesign
Section.backcolor = RGB(255, 255, 255)
DoCmd.Close acForm, doc.Name, acSaveYes
Next doc
ExitHere:
Set dbCur = Nothing
Exit Sub
ErrHandler:
Select Case Err.Number
Case 438 'Property does not exist
Resume Next
Case Else
MsgBox Err.Number & " - " & Err.Description
Resume ExitHere
End Select
End Sub
It seems to run through all the forms but doesn't change the backcolour and
when it's finished running I get an error message
424-Object required
Anyone help me with this?
Thanks
Tony
in a module
Public Sub ChangeAllControlProps()
Dim dbCur As Database
Dim doc As Document
On Error GoTo ErrHandler
Set dbCur = CurrentDb
For Each doc In dbCur.Containers("Forms").Documents
DoCmd.OpenForm doc.Name, acDesign
Section.backcolor = RGB(255, 255, 255)
DoCmd.Close acForm, doc.Name, acSaveYes
Next doc
ExitHere:
Set dbCur = Nothing
Exit Sub
ErrHandler:
Select Case Err.Number
Case 438 'Property does not exist
Resume Next
Case Else
MsgBox Err.Number & " - " & Err.Description
Resume ExitHere
End Select
End Sub
It seems to run through all the forms but doesn't change the backcolour and
when it's finished running I get an error message
424-Object required
Anyone help me with this?
Thanks
Tony