Changing form colours 'en masse'

D

David Gartrell

Hi Everyone

Don't know if anyone can help me with this but i have an Access 2000
database with nearly 20 different screens (forms) and each has the same
colour scheme. What I want to do is to make a copy of this database but i
want to change the colours of all the forms so i can differentiate it from
the original database if i should need to run both of them at once.

Rather than going through each form individually and changing the colours on
each is their a faster way i could do this - I was hoping to use VB.

If anyone could help me with this then i'd be very grateful.

many thanks

David.
 
R

Roger Carlson

Rick Fisher's "Find and Replace" utility will do this for you. You can
download a shareware copy from here: http://www.rickworld.com/download.html.
Since I registered my copy, I'm not sure if this functionality is included
in the download version, but registering it is cheap and well worth it.

--
--Roger Carlson
Access Database Samples: www.rogersaccesslibrary.com
Want answers to your Access questions in your Email?
Free subscription:
http://peach.ease.lsoft.com/scripts/wa.exe?SUBED1=ACCESS-L
 
B

Brendan Reynolds

I'll second Roger's recommendation of Find and Replace. If you're still
interested in writing your own code, though, here's an example that will
change the colour of the Detail section - it will need some modification if
you want to handle header and footer sections as well.

Note - this code makes and saves design changes without prompting - don't
run it on your only up-to-date copy of your mission-critical masterpiece
without making a back up first, OK? :)

Public Sub ChangeColor()

Dim aob As AccessObject

For Each aob In CurrentProject.AllForms
DoCmd.OpenForm (aob.Name), acDesign, , , , acHidden
Forms(aob.Name).Section(0).BackColor = vbBlue
DoCmd.Close acForm, aob.Name, acSaveYes
Next aob

End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top