highlighting based on VBA code

zar786

Registered User.
Local time
Today, 00:20
Joined
Mar 30, 2005
Messages
11
Based on the players PCI BMI (see other post) i need to highlight all players were they are out of range within normal BMI, which for men is 20.7 to 26.4 and for women 19.1 to 25.8, i've tried doing this using a select query on a textbox control source, however nothing comes up:

SELECT IIf(bmi Between 20.7 And 26.4, "Normal", "AbNormall")

this would only be for men also, not sure how to implement it for both sexes, after this i assume i would need to make a new module which gives the criteria and formatting commands to highlight BMI outside normal range, would i also need to make a new field in the player table?

All help much appreciated.
 
zar:

Add this to your query (indented for readability):

Code:
NewField: IIf([Sex] = "M", 
              IIf([bmi] Between 20.7 And 26.4, "Normal", "AbNormal"),
              IIf([bmi] Between 19.1 And 25.8, "Normal", "AbNormal"))

That will give you a new field. You can use the form's Conditional Formatting
to alter appearances based on this, or you can use the form's OnCurrent event.

Wayne
 

Users who are viewing this thread

Back
Top Bottom