Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Is it possible to have numbers and text as Field data type 1

Status
Not open for further replies.

manoskok

Technical User
Mar 15, 2001
20
GR
I have a table where I put microbiological results.
My problem is that for a specific field, which is number data type, I want to have the possibility of entering the value <1 or a specific word.
Is it possible to use a validation rule in order to allow the specific text?
What are the consequences when I try to graph these values ?
Thanks in advance.
 
Good morning Manoskok,
If you keep all your records as a text field you'll be liable to receive some odd sort orders. You can &quot;clip&quot; the field in a query or function and work with the numbers or text as an option using the InStr function and Left/Mid/Right functions. I have crossed this problem before and found splitting the &quot;number&quot; at the source was the cleanest approach: I have a field parallel to the number that I call the &quot;prefix&quot; (Text). Number remains a number. Through a simple query you can blend the two together again for &quot;visual&quot; purposes on forms etc. but for sorting~searching you can now work off of either. Hope this helps you, Gord
ghubbell@total.net
 
Thanks for the help.
Is there an easier way, because I have more than 20 fields in the table ?
 
Well I guess you'd have little choice other than changing the number fields to text fields (that's really just a flip of a switch). In any field you need a validation rule be it a number or text, you can simply write in what you want in its validation rule property &quot;field&quot; either in a table or on a form: If on the form you're using you only want <1 (meaning less than one numerically) you are out of luck, but if you could change that to text in some way depending on your data you're covered. Graphs? your guess is as good as mine. Sorry to not be of more help. Gord
ghubbell@total.net
 
If you want to graph on a field, I'd suggest not using a text data type. I'd suggest creating an additional field for comments where you can put text in. You can't average or sum fields that have text in them to my knowledge, they must be number fields.
 
You could always create a recordset from the table using a VBA routine and the VAL function, which gets a number from the text representation. You won't get values for the free form entries.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top