Page 1 of 2 12 LastLast
Results 1 to 15 of 20
  1. #1
    Silver Lounger
    Join Date
    Jun 2002
    Location
    Cheadle, Staffordshire
    Posts
    2,177
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Form Design (A2000)

    I have about 100 forms now in my db and am playing about with colours and the general look of the forms.

    I have come up with a design which ( I Think ) is pleasing on the eye and not over-powering (See Attach ).

    The problem I have, is the labourious task of changing each form to suit.

    Detail background = 15132390
    Label / Title = 13816530
    Frame border = 12500670

    etc etc.

    I wondered if there was a way of globally changing these via a standard module of some kind, on open or something.

    Also, if a user sets his scheme differently than another user, will these values still apply whichever scheme combination is used ??
    Attached Files Attached Files

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Form Design (A2000)

    Dave,

    Colours such as 15132390 are fixed, they do not depend on or change with the user's display settings. Colour values such as -2147483633 are system colours (this one is the "buttton face" colour); they depend on and change with the user's display settings.

    You can write code to change colours, but you have to know exactly which elements to change etc. To do it, loop through the AllForms collection, open each element (form) in design view, change some things (loop through the controls collection, if it is a label do this, if it is a frame do that), save and close the form, etc.

    This can be dangerous if there are elements that should *not* conform to the general settings.

    PS The form in your screenshot has Scrollbars = Both; since they are not needed, I would recommend setting it to Scrollbars = None.

  3. #3
    Silver Lounger
    Join Date
    Jun 2002
    Location
    Cheadle, Staffordshire
    Posts
    2,177
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Form Design (A2000)

    Yes, I see what you mean Hans.

    Basically, don't mess.
    It would be nice to change the default of the drab items, ie buttons etc.
    I see a global code maybe slowing things down also.

    p.s
    Still got the network server problem, our IT are not too sure how to fix it.
    and
    Scroll bars sorted, thanks again.

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Form Design (A2000)

    Dave,

    I wouldn't recommend changing the colour setting of all forms in runtime (in the Open or Load event) - that would slow down things enormously, especially on older PC's.

    But you could write code that you execute once to update all forms when you want a different colour scheme. You could create a table that holds the design changes; that way you wouldn't have to hard-code the colours into the code. If you wanted to exclude certain forms and/or certain controls, you could also create a table that stores the names of the exceptions.

    It depends on how often you're going to change the design. If you're still toying with it, or if you'll be going through the same phase in other databases, it might be worth spending some time on automating it.

  5. #5
    Silver Lounger
    Join Date
    Jun 2002
    Location
    Cheadle, Staffordshire
    Posts
    2,177
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Form Design (A2000)

    Hans

    I usually complete a design or colour scheme whilst still working on that particular form.
    By this, I'm not forever chasing my own tail.
    But, being so far into this db, I've got to change what I've already done so far.

    Never mind, it won't take me long !!

  6. #6
    4 Star Lounger
    Join Date
    Feb 2001
    Location
    Richland, Washington, USA
    Posts
    407
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Form Design (A2000)

    Dave,

    Something else to consider: If you want some consistent coloring scheme that's different from the system colors, I'd suggest assigning those colors to the relevant controls in the Form_Open event using VBA constants (e.g. conStandardBackColor defined as 1123423 or whatever) rather than explicitly entering the number in the property sheet. This way, if you ever chose to change your scheme, all you have to do is change the constant definitions (maybe three or four values), not a zillion properties for a hundred forms. You may decide that adding in all the code up front for this many forms is just not worth it, though.

    One other thing: Once everything looks okay, I'd suggest checking the appearance on another machine (or change your own machine's WIndows color scheme) and check all your forms to make sure they still look okay -- you may find some controls or backgrounds or whatever that are picking up the (changed) Windows default colors when you don't really want them to.

    Been down this road...

  7. #7
    Silver Lounger
    Join Date
    Jun 2002
    Location
    Cheadle, Staffordshire
    Posts
    2,177
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Form Design (A2000)

    Cheers Tom for your input.
    I shall certainly look into this.

  8. #8
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    Newbury, Berkshire, England
    Posts
    712
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Form Design (A2000)

    Hi Dave,

    This could be of use.

    Oh, ONLY Use it on a backup DB, until your happy with it!!!
    Attached Files Attached Files

  9. #9
    Silver Lounger
    Join Date
    Jun 2002
    Location
    Cheadle, Staffordshire
    Posts
    2,177
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Form Design (A2000)

    Hmmmmmmm, Worked on a backup as you said.

    This will save me some time, I'm sure.

    Thanks Rup

  10. #10
    Silver Lounger
    Join Date
    Jun 2002
    Location
    Cheadle, Staffordshire
    Posts
    2,177
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Form Design (A2000)

    Wow, I tried the demo with a db with only one form and it worked ok.

    I then tried on a copy of my db with the 100 or so forms, 10 seconds to change the lot, brilliant.

    Any help to adapt the demo to change labels, text boxes to border flat, fonts - bold,black, would really make a superb utility for all.

    Thanks again Rup. Brilliant.............................

  11. #11
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Form Design (A2000)

    Dave,

    I have taken the liberty to adapt Ruperts form. I have attached the modified version. It is not meant as a finished product, just as a demo, to be expanded and fine-tuned according to your needs.

    This version will (try to) change not only the background color of form sections, but also the font, border and color properties of labels, text boxes and command buttons. The label, text box and command button in the detail section will be taken as model. If you want to enforce uniform formatting of other controls, such as list boxes, combo boxes, etc., put one in the detail section of the form, and set the properties according to your preference. Then, go to the OnClick code for the command button. The central loop in the event routine loops through all controls on a form:

    For Each ctl In frm.Controls
    Select Case ctl.ControlType
    Case acLabel
    ...
    Case acTextBox
    ...
    Case acCommandButton
    ...
    End Select
    Next ctl

    Add a Case for each control type you want to handle, e.g. Case acListBox, and add code to set font, border style, etc. equal to those of the model control.

    Note: as I warned in a previous reply, enforcing uniform formatting may have undesired effects. You may have labels in a large or different font, etc. This will be overridden by the color change routine, so you will have to restore the settings of those controls manually.

    <img src=/w3timages/blueline.gif width=33% height=2>

    Instructions for use:
    <UL><LI>Open frmColorChanger in design mode.
    <LI>Set the background color of the sections.
    <LI>Set the font, background and border properties of all controls in the detail section.
    <LI>Save and close the form.
    <LI>Import the form into a copy of one of your databases. Always work on a copy. Changes are not easily undone!
    <LI>Click the command button.
    <LI>All forms will be modified. This can take a while, depending on the number and complexity of forms in your database and on the speed of your computer.
    <LI>When the modification is finished, look at the result.[/list]Enjoy!
    Attached Files Attached Files

  12. #12
    Silver Lounger
    Join Date
    Jun 2002
    Location
    Cheadle, Staffordshire
    Posts
    2,177
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Form Design (A2000)

    <img src=/S/sneaky.gif border=0 alt=sneaky width=15 height=15> <img src=/S/evilgrin.gif border=0 alt=evilgrin width=15 height=15> <img src=/S/sneaky.gif border=0 alt=sneaky width=15 height=15>

    Brilliant

    <img src=/S/sneaky.gif border=0 alt=sneaky width=15 height=15> <img src=/S/evilgrin.gif border=0 alt=evilgrin width=15 height=15> <img src=/S/sneaky.gif border=0 alt=sneaky width=15 height=15>

  13. #13
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Form Design (A2000)

    Thank you.

    An additional remark: modifying the design of all forms in batch will cause the size of the database to balloon. Be sure to do a Compact and Repair when you've finished.

  14. #14
    Silver Lounger
    Join Date
    Jun 2002
    Location
    Cheadle, Staffordshire
    Posts
    2,177
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Form Design (A2000)

    Hans, Where can i find a list of all controls:

    acText
    acButton etc etc

    p.s

    This would really be useful as an MDA add in, Something for you to think about !!

    Thanks for saving me hours here. <img src=/S/thankyou.gif border=0 alt=thankyou width=40 height=15>

  15. #15
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Form Design (A2000)

    To get a list of control types:

    Switch to the Visual Basic Editor (Alt+F11) [For Access 97 users: open any module]
    Activate the Object Browser (F2)
    Type "controltype" (without the quotes) into the search box and press Enter.
    You will see a list of constants acBoundObjectFrame, acCheckBox etc. corresponding to all control types in Access. Non-native controls (ActiveX controls such as TreeView, ListView etc.) are of type acCustomControl.

    <img src=/w3timages/blueline.gif width=33% height=2>

    To make this into an add-in, it would have to be much more flexible and comprehensive. As it is, it takes a sledgehammer approach; I wouldn't want to be responsible for the mess it can cause <img src=/S/grin.gif border=0 alt=grin width=15 height=15>

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •