October 15, 200916 yr Quick background first. Pretty familiar with MS Access albeit a year rusty, and am now working in a Filemaker environment, have literally just installed FM10, and am very new. I'm trying to create a field that autofills itself with the first five letters of a company name (once a company name is entered into the company name field), then sticks a unique 5 digit number on the end. For example, if I create JobServe as a company, it should autofill as; JOBSE/10000 Then if I add IBM as a company it should go in as; IBM__/10001 (_ is used to denote two spaces) Hope that's clear! Is this possible? Thanks in advance. Edited October 15, 200916 yr by Guest
October 15, 200916 yr Hi Steve, welcome to FM Forums! I suggest you keep the auto-enter serial number of 10000 and increment by 1. And use THIS id (called CustomerID) for all relationships. YOu really don't want to use a field with meaning (part of the company name) for relationships because, what if they change the company name (hey, it can happen)? Unique serials should be meaningless. Then you can create a calculation (type text) with your special 'display' number you've requested (just be sure you don't use this number for relationships): Let ( [ co = Left ( CompanyName ; 5 ) ; pad = 5 - Length ( co ) ] ; co & Right ( "_____" ; pad ) & "/" & CustomerID ) This calculation has 5 spaces within the quotes, indicated by 5 underlines.
Create an account or sign in to comment