EGG said:
Is there a way to change the background style of a form once it is
created?
Sure, open the form in design view. Open the property sheet and change the
Picture property of the form or, to change the color, click on each section
and change it. You can do them all at once by changing the following code to
your need:
Public Sub SetBackColor()
' Arvin Meyer 11/1/2007
On Error GoTo Error_Handler
Dim doc As DAO.Document
Dim db As DAO.Database
Dim frm As Form
'Dim ctr As DAO.Containers
Set db = CurrentDb
'Set ctr = db.Containers!Forms
For Each doc In db.Containers("Forms").Documents
DoCmd.OpenForm doc.Name, acDesign
Set frm = Forms(doc.Name)
frm.Picture = "(none)"
On Error Resume Next
frm.Section(0).BackColor = 16777215
frm.Section(1).BackColor = 16777215
frm.Section(2).BackColor = 16777215
DoEvents
DoCmd.Close acForm, doc.Name, acSaveYes
Next
Exit_Here:
'Set ctr = Nothing
Set doc = Nothing
Set db = Nothing
Exit Sub
Error_Handler:
MsgBox Err.Number & ": " & Err.Description, vbOKOnly, "Error"
Resume Exit_Here
End Sub