F
Frank Dulk
does have as changing the properties of forms type COLORS, BORDERS,through
the vba?
the vba?
Jeanette Cunningham said:Here is some sample code that changes properties of controls on forms.
I haven't used this code, but you could adapt it to change borders and
backcolor for forms.
----------------------------
Public Sub ChangeProperties()
Dim Db As Database, doc As Document, ctl As Control
Set Db = CurrentDb
On Error GoTo Err_Handler
For Each doc In Db.Containers("Forms").Documents
DoCmd.OpenForm doc.Name, acDesign, , , , acHidden
For Each ctl In Forms(doc.Name)
If TypeOf ctl Is Label Then
ctl.FontName = "Arial"
ctl.FontSize = 7
ElseIf TypeOf ctl is TextBox then
ctl.FontName = "TimesNewRoman"
ctl.FontSize = 10
End If
Next
DoCmd.Close acForm, doc.Name, acSaveYes
Next
Exit_ChangeProperties:
Set Db = Nothing
Exit Sub
Err_Handler:
MsgBox "Error #: " & Err.Number & vbNewLine & Err.Description
Resume Exit_ChangeProperties
End Sub
---------------------------------------------
The above assumes you wish different fonts, etc. for different types
of controls. Add other control types as needed, or combine them into an
If.. Or..
ElseIf .. Then statement.
When I need to do this I use a handy utility called Find And Replace by
Rick Fisher.
If you google for Rick Fisher you will find his website and this utility
for purchase.
There are other utilities that do the same thing, FMS Inc has one and I
think there has been a free one mentioned on the access groups - I don't
have its details handy.
Jeanette Cunningham MS Access MVP -- Melbourne Australia