default value

  • Thread starter Thread starter oscar
  • Start date Start date
O

oscar

I need the default value of a field to be determined by a
scale that is based on another field. I have to fields
score and rank. The rank is be based on a scale of the
score. For example, if a score of "79" is entered, the
default value for the corresponding rank field would
be "Proficient", in accordance to whatever the scale would
be.
 
Oscar,

You could put code similar to this on the AfterUpdate event of the
Score control...
If Not IsNull(Me.Score) Then
Me.Rank = Switch(Me.Score > 90, "Expert", Me.Score > 75,
"Proficient", ... Me.Score < 20, "Hopeless")
End If

'Hard-coding' it like this has ther disadvantage that if the score
ranges or rank categories ever got changed, you would have to edit
your code, but otherwise it is a simple solution.

- Steve Schapel, Microsoft Access MVP
 
Back
Top