Full Version: Easy Way To Format Forms?
UtterAccess Discussion Forums > Microsoft® Access > Access Forms
karenedmonds
Hello!
I have quite a few forms that I need to change regarding format (colours, size and placement of buttons, etc).
They all have several command buttons on them.
I would like to be able to apply a pre-determined format to each form, based on the new changes, rather than have to manually change each one.
I know one process would be to create the form I want, and then copy for each subsequent form.
But I'd like to avoid having to change the events on each command button, which are different on every form.

Is there a way to do this? Thanks smile.gif
merlenicholson
I do this regularly - and it may or may not appeal to you, but in my case I would have an unmanageable number of objects in this app if I didn't do it this way - and it has more than 175 objects now.

I use multiple instances of a form. I call a function that launches that particular version of the form and modifies colors, button positions, Hide buttons and exposes other buttons. I have buttons stacked on one another and I'll hide some and unhide others. So the first thing is to Dim a new form and assign the basic form to it, make all the changes to it and then destroy the form on exit of the function. The basic form remains unchanged. I even assign different subforms.

The good and the bad news is that the basic form is unchanged. Lets say if you assign a subform that displays as a datasheet, and the user hides/unhides columns or adjusts column widths, the next time that datasheet is opened, those modifications are lost. In this situation that was unacceptable so now I save the datasheet column widths and Hide values in a small table on exit and readjust on open. It turned out to be simple in the end. It's also more difficult to troubleshoot code while the form is open.

There's more to this of course - if you are interested and need anything further let me know.
karenedmonds
Thanks Merle.
That sounds very impressive!
I think perhaps a little beyond my capabilities though smile.gif
I can see further down the track I could have a need for something similar and hope you don't mind if I touch base with you then.

Thanks again.
Have a nice day!
merlenicholson
Happy to help - all my contact info is in my profile.
JonSmith
What you are asking for can't be done afaik without some extra effort this time/during design process. If this is going to be a regular thing then it would be worth it. If you are doing it once, just do it by hand.

If it is the former, can I suggest using the tag property on controls to specify a certain type of formatting category. So you might have "Command Buttons", "Textboxes" etc.
You can then write a function in vb that would loop through all the controls on a form and using a case statement apply the particular formatting you are wanting to apply that time. If you wanted to go a step further you could even design a 'Template' form that would have a single instance of each 'Control type' and then have the function cache all the formatting options for that control and then apply it to the rest of the forms. That way when you wanted to apply new designs you would just need to redesign the template form and run the code. Rather than re-coding each time.
karenedmonds
Thanks Jon - agree.
One of those situations where I should have really thought it out better prior to launching into copying all the forms!
I originally made one form as a template, and then developed all the others from it.
Problem is, now I don't like the end result of the overall feel of the form and want to change all the formatting (now that I have seen it in "action").
I don't think I have a choice, but to go through and make these changes manually.
It's not too big a deal, I would just kick myself if I found out there was an easier way to do it - after I'd spent hours mucking around.

Thanks again to you both.
Cheers from Australia! smile.gif
theDBguy
Hi Karen,

Probably not what you need but thought it's a good example of what's possible...

Candace Tripp's Skinned demo in the Code Archive.

Just my 2 cents... 2cents.gif
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.