jcc31 Posted February 1, 2005 Posted February 1, 2005 Hi, I was wondering in Filemaker 7 if there is a way that the slashes or dashes be put in place as the user enters eight digits in a field. I.E. as I input 03 than a slash appears automacatelly then input 26 then another slash then input 2005. Thanks in advance.
rdhaden Posted February 1, 2005 Posted February 1, 2005 you could have the data entry field be a text field, auto-enter by calculation, replaces existing value, with the calculation being: Left ( field; 2 ) & "/" & Middle ( field ; 3 ; 2 ) & "/" & Middle ( field ; 5 ; Length ( field ) - 4 ) but if the user did put the dashes or slashes in, you'd get odd results, so this would be better: Let ( [ text = Substitute ( Substitute ( field ; "/" ; "" ) ; "-" ; "" ) ] ; Left ( text; 2 ) & "/" & Middle ( text ; 3 ; 2 ) & "/" & Middle ( text ; 5 ; Length ( text ) - 4 ) ) You could validate length being 8, but since it does the auto-enter before the validation, you'd have to take the inserted dashes or slashes into account, so similarly, the validation calculation could be: Let ( [ text = Substitute ( Substitute ( field ; "/" ; "" ) ; "-" ; "" ) ] ; Length ( text ) = 8 ) Then if you needed the result as a date, have another calculation field, date = GetAsDate (field) on which you do whatever date calculations or scripts, or whatever.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now