Navigation:  Articles > Aug-1997 >

Tip: Mixing Validation Rules

Previous pageReturn to chapter overviewNext page

Steve Sarre

 

If you have a field that mainly contains numeric data, but that also needs to allow the user to record text values (such as "High", "Medium", or "Low"), here's how to do it. First, define the field as Text and set up a field level validation rule as follows:

 

 ([Data] & IIf(IsNumeric([Data]),IIf([Data] Between 

0 And 99,Null,"Error"),"Error")) Or Is Null Or "High" 

Or "Medium" Or "Low"

 

Then set the Validation Text to "Please enter a numeric value between 0 And 99 or High, Medium, or Low (or leave blank)". You're done!