February 1, 200521 yr 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.
February 1, 200521 yr 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.
Create an account or sign in to comment