Full Version: Picture statment suggestion
UtterAccess Forums > Microsoft® Access > Access Forms
WSplawn
I have a field on a form that requires data in a certain format. It would be helpful if I could devise a picture statement for it, or, I guess you would call it an expression. The field requires the following:
Any number of digits before a dash and two digits after the dash. For example:
234512-01
4569-02
590328-10
Additionally:
it is possible for the user to enter a value of digits with no dash, as follows:
39846
Additionally: I'm sorry to say this but there is one last thing that makes it a little more difficult. The value could also end with an alpha character, as follows:
34867-01B
For simply an alpha character, with no preceeding numeric, as follows:
45937-A
It may be that the better solution is to try to talk the client into something a little more standard with regard to uniformity, but I thought this would be a good question to ask about, here on this forum.
Any suggestions appreciated. If the values are not too un-uniform, Perhaps there is a web page or white paper somewhere that will give me ideas or suggestions.
Thank you
WSplawn
After further consultation I have discovered that the format for the field I have been talking about should always be in one of the following three formats:
12345
S12345-01
S12345-01A
That is, the number before the dash will always be an S, followed by five digits. There may or may not be a two digit value after the five digits, but if there is it should always be preceeded with a dash. Occasionally, that two digit number may be followed by a one character alpha on the end.
Given the above business rule, I might re-ask the question on the kind of picture staement that may assist me in this.
fkegley
First of all, do not let them type the S. Put that into the field in some other way, since they will always have the S I would use a format to do it.
econd you can use this, I believe, but you'll need to check me in the Input Mask property of the text box.
>00000\-99?;;
The > than forces any letters to be converted to UpperCase, the 0 represents a required digit, the \ indicates that the character that follows is to be interpreted literally, that is the - will appear in the mask. The 9 indicates optional digit, the ? represents optional letter. The ; indicates the end of the mask itself, what follows is whether or not to store the - in the table, no entry usually means not, nothing after the second ; means use the default input mask placeholder character, _ .
This is all documented in the help files.
This is a "lo-fi" version of UA. To view the full version with more information, formatting and images, please click here.