Formating the SubForm

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ammoos
    New Member
    • Apr 2007
    • 100

    Formating the SubForm

    Hi Friends

    I need to format the Subform in a form.

    The subform contains 2 columns and first column is name and second is age.

    If the age is above 20 then the corresponding names should display in a blue color and the other names that’s the age under 20 will show in black...

    I have no idea about how its possible

    pls help me as soon as possible

    thanks

    Ammoos
  • Delerna
    Recognized Expert Top Contributor
    • Jan 2008
    • 1134

    #2
    Hi amoos
    check this thread and see if it helps

    Comment

    • ammoos
      New Member
      • Apr 2007
      • 100

      #3
      HI Delerna

      Many thanks for your reply. I want to format the subform when its load first time. I mean when its first display in front of the user. How can it possible. Si I think the formating codes will apply just after the recordsource is set.. pls advice me..

      thanks

      Ammoos

      Comment

      • ammoos
        New Member
        • Apr 2007
        • 100

        #4
        Pls............ ............... ....... help me

        Comment

        • Stewart Ross
          Recognized Expert Moderator Specialist
          • Feb 2008
          • 2545

          #5
          Originally posted by ammoos
          Pls............ ............... ....... help me
          Hi Ammoos. I read your post and Delerna's reply, which is good advice. The thread he points you to covers conditional formatting, which is exactly what you need to change the font colour when a control value is under a particular threshold.

          Your subsequent reply is difficult to interpret - you mention formatting before the recordsource is set, but when there is no recordsource there are no values to display. As this does not make sense can you explain further what you mean?

          -Stewart

          Comment

          • ammoos
            New Member
            • Apr 2007
            • 100

            #6
            Hi Stewart

            I mentioned clearly as I want to format the subform after setting the recordset..

            Can u pls advice

            Originally posted by Stewart Ross Inverness
            Hi Ammoos. I read your post and Delerna's reply, which is good advice. The thread he points you to covers conditional formatting, which is exactly what you need to change the font colour when a control value is under a particular threshold.

            Your subsequent reply is difficult to interpret - you mention formatting before the recordsource is set, but when there is no recordsource there are no values to display. As this does not make sense can you explain further what you mean?

            -Stewart

            Comment

            • missinglinq
              Recognized Expert Specialist
              • Nov 2006
              • 3533

              #7
              Originally posted by ammoos
              If the age is above 20 then the corresponding names should display in a blue color and the other names that’s the age under 20 will show in black...
              And when the age is exactly 20, what color?

              Presumably your your subform is either Continuous or Datasheet View, so the easiest way to do conditional formatting will be thru the menu. Open the form used as the subform in Design View and select the field that holds your names, then, on the menu
              1. Goto Format - Conditional Formatting
              2. Condition1
              3. Expression Is [AgeFieldName]< 20
              4. Select Black as the Fore Color
              5. Click on Add
              6. Condition2
              7. Expression Is [AgeFieldName]> 20
              8. Select Blue as the Fore Color
              If you want a third color if Age = 20 what you do depends on whether it's a Datasheet View or a Continuous View.

              If it's Continuous, you can simply change the color that's now displayed at the top of the Conditional Formatting Dialog box for Default Formatting.

              If it's Datasheet View you'll have to Add the
              Condition3
              Expression Is [AgeFieldName] = 20
              Then select your color

              Linq ;0)>

              Comment

              • ammoos
                New Member
                • Apr 2007
                • 100

                #8
                Thanks much Missinglinq..

                Comment

                • missinglinq
                  Recognized Expert Specialist
                  • Nov 2006
                  • 3533

                  #9
                  Glad we could help!

                  Linq ;0)>

                  Comment

                  Working...