Connecting Tech Pros Worldwide Forums | Help | Site Map

Formating the SubForm

ammoos's Avatar
Member
 
Join Date: Apr 2007
Posts: 89
#1: Feb 29 '08
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's Avatar
Expert
 
Join Date: Jan 2008
Location: Sydney
Posts: 790
#2: Feb 29 '08

re: Formating the SubForm


Hi amoos
check this thread and see if it helps
ammoos's Avatar
Member
 
Join Date: Apr 2007
Posts: 89
#3: Feb 29 '08

re: Formating the SubForm


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
ammoos's Avatar
Member
 
Join Date: Apr 2007
Posts: 89
#4: Mar 3 '08

re: Formating the SubForm


Pls.................................. help me
Moderator
 
Join Date: Feb 2008
Location: Beauly, near Inverness, Scotland
Posts: 1,576
#5: Mar 3 '08

re: Formating the SubForm


Quote:

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
ammoos's Avatar
Member
 
Join Date: Apr 2007
Posts: 89
#6: May 5 '08

re: Formating the SubForm


Hi Stewart

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

Can u pls advice

Quote:

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

missinglinq's Avatar
Moderator
 
Join Date: Nov 2006
Location: Richmond, Virginia USA
Posts: 3,002
#7: May 5 '08

re: Formating the SubForm


Quote:

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)>
ammoos's Avatar
Member
 
Join Date: Apr 2007
Posts: 89
#8: May 7 '08

re: Formating the SubForm


Thanks much Missinglinq..
missinglinq's Avatar
Moderator
 
Join Date: Nov 2006
Location: Richmond, Virginia USA
Posts: 3,002
#9: May 7 '08

re: Formating the SubForm


Glad we could help!

Linq ;0)>
Reply