Re: Update form formatting on FLY?



<vonclausowitz@xxxxxxxxx> wrote in message
news:1129795914.723396.65720@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> 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






.



Relevant Pages

  • RE: automatically populate a field in a form
    ... The sample Northwind database has many examples you can look at. ... Window) from the database window. ... Properties from the form design window. ... The Control Source property is where the control gets its data, ...
    (microsoft.public.access.forms)
  • Re: unable to set a default value to multi-column combo box
    ... to do is to extract a list of course IDs from the database. ... I am checking the code and form design again. ... You mentioned that I can just set the DefaultValue property in form ...
    (microsoft.public.access.formscoding)
  • Re: Filtering
    ... Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia ... Option Compare Database ... on a form control, by viewing the form's Properties; ... The property value in form design should show [Event ...
    (microsoft.public.access.formscoding)
  • Re: Allen Browne Search Code
    ... It is difficult to guess your table structures, relationship and form design ... with seeing the database. ... Have you look into one of the problems with subform filtering from Allen ... Thanks for any guidance! ...
    (microsoft.public.access.formscoding)
  • Form/Table Locked
    ... I'm at an impasse! ... database is opened I have it set so the form opens first. ... go into form design or even try to close Microsoft Access I get ...
    (microsoft.public.access.gettingstarted)