• Rows and colors

    Author
    Topic
    #1768559

    I have an order form. I’d like to make every other row a different color. How? On a report it’s easy: Me!Detail.Backcolor = vbYellow (or somesuch) Help!

    Viewing 3 reply threads
    Author
    Replies
    • #1779970

      First of all, why? Second, you can’t do this with a continuous form–reports are an entirely different animal. You only have one row worth of controls, so any formatting you apply applies to every record. Reports actually print one record at a time.

      • #1780012

        Why?!? There is a lot of information in each row, and I was looking for a way to make it more readable and to more accurately match the report that prints off of it (which has the multi colors. I realize that there is no way to do this “Built-in” I was just wondering if anyone knew of a work around. One thought that I had was to set a running count and to format the backs of the records based on the mod of the count (1 is odd, 0 is even, if 0 give a color). However I can’t find an event to make it trigger. We’ve pretty much given up on the idea, but I’ve seen other (non-Access) programs with the feature and it would’ve been cool. O well.

        • #1780017

          If you are displaying so many records on a form that it requires alternating colors, you have a form that needs redesigning. Forms and reports are NOT intended to serve the same purpose, and it is a bad idea to try and design forms to look like a report, no matter how much sense that makes to end users. Forms are primarily for entering and editing data, and they should be designed to facilitate that process. Reports are for outputting results and compilations and analyses.

          • #1780018

            err. . .

            I know reports and forms are not used to display the same info. This particular report is an invoice so it does help if it matches what is on the order.

            Also the product catalog could do with some sprucing up so I thought that might be the way to go, but if it can’t be done it can’t be done. No sweat, we’ll just do something else.

            The amount of data is not too much per se, there are just many lines. I thought it might help to differentiate between the lines on the order and in the catalog. That said, I am dealing with restraints that have been placed upon me, and I am just trying to make the best out of a bad situation. I was just looking to see if someone knew how to help.

            Guess not. Sorry to waste your time.

    • #1780024

      Try this link: http://www.mvps.org/access/forms/frm0024.htm

      It apparently only works in Access 97, so if you’re using 2000 you may need to tweak the code (or you’re out of luck). This isn’t quite what you’re looking for as it’s not designed to color every other row, but again maybe you can come up with a way to accommodate this.

      It seems to me I have seen code that does what you’re asking for but I can’t remember where I saw it. Of course I’ve seen this same thing for reports which works quite well but as Charlotte explained doing this on a continuous form is much more difficult if it’s even possible.

      HTH

      Dave

      • #1780026

        Yes!!! This will work, i can use a webdings “g” all the way across and fake it!!! Thanks so much for all the help and the explanations. I’m still going to take a hard look at that form and see if maybe a redesign *is* called for. . . Thanks for all the help!

    • #1780071

      Here is a little demo db which does what you want, I think. The trick is to have a table (tblColours) with small coloured bitmaps to use as colour swatches in an unbound object frame on your form. You can use it for multi-coloured forms if you like!

      • #1780078

        I havn’t been able to open any of these .mdb attachments. I have Office 97 SR-2 on Windows 95. I get the “Unrecognized database format.” error.

        • #1780079

          Sorry I forgot the Access97 users out there! Here is the 97 version zip file for you.

    • #1780558

      You don’t say what version you use but the following sample works for 2000 using conditional formatting.
      The stripes go a bit screwy if you add records but for a browse form they work great

    Viewing 3 reply threads
    Reply To: Rows and colors

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: