<vo***********@gmail.com> wrote in message
news:11*********************@g14g2000cwa.googlegro ups.com...
Hi Everyone,
Is it possible to create some code which can automatically update my
forms formatting?
I have a small database with a form which is periodically changed. When
the db is returned to me the form looks completely different. Different
fore- and background colors, font types etc...
Is there something in code I can use to set the form back to how I
normally use it?
Marco
Whilst it is possible to do this, if someone is altering the design of the
form against your will, they could alter the code too. If you sent the
database to be altered, but didn't want this form to be touched, then what
did you need changing? Perhaps just the data? Also, are you sure the other
person is not expressing the same frustration that someone keeps changing
the form design.
If you only needed the data changing then consider splitting the database
front end (forms, reports, etc) and back end (only data tables). Send
across both bits but only use the returned backend.
If the person is changing the form because he has problems with his eyesight
or has a small/low resolution monitor, then it may make sense for you to
keep different front ends. If there is no real reason for the form to be
changed, then you could send an mde file to lock down these changes.
If you still require code, then post again, but basically you can set things
like this in the form's open event. Write a sub/function in a module so it
can be re-used for multiple forms, so you could write SetupForm(Me)
Public Sub SetupForm(frm As Form)
frm.Detail.BackColor=255
For Each ctl In frm.Controls
With ctl
Select Case .ControlType
Case acLabel: ' Format the label
Case acTextBox: ' Format the textbox
Case acComboBox: ' Format the combobox
Case acCheckBox: ' Format the checkbox
End Select
End With
Next ctl
End Sub