Currently I'm working on a test Invoice system. Right now I just have two tables. One is Test_Main, and the other is Test_Invoice. Just for testing, I only have 3 fields in each; CustomerName, CustomerPhone, and CustomerComments. I'm relating the tables with CustomerPhone (because their phone number is their account). When I go to Test_Invoice and type in the phone number (with the dashes and such) I have the other fields doing a Look-up to get the name of the customer. My problem comes in when I want the phone number to auto format.
For example, user types 1234567890 hits enter and it formats the field and shows 123-465-7890. Doing this I just coded the following in the Calculated Value under Auto-enter:
:
Let (
[
rawPH = Filter ( CustomerPhone ; "0123456789" )
];
Left ( rawPH ; 3 ) & "-" & Middle ( rawPH ; 4 ; 3 ) & "-" & Right ( rawPH ; 4 )
)
Now, when I type in the phone number (12346790) and hit enter it formats correctly showing 123-456-7890 but the other fields did not retrieve data, like the customer name does not appear. However, when the user types the phone in correctly (123-456-7890) the customer name and the other fields display the data.
Could the reason be the calculations are running after the other fields do their look-up? If so, how can I fix this problem? I do not want a button running a script. I want this to be as simple as possible (like hitting enter and it works).