MMBadger Posted July 8, 2003 Posted July 8, 2003 I am having difficulty with the auto-enter calc text field. The field is calculated before all referenced fields are complete, thus an incomplete value is entered and the user basically has to formulate the calculation themself. The scenario: I am trying to make a unique "Account ID" based upon the following 4 pieces of information: -Client Name Parse (a 3 letter code culled from the Client Name - i.e. Michelle Moulton Badger would be MMB, etc.) -Month of Program Start Date in 2 digits ("07") -Year of Program Start Date in 2 digits ("03" -In some cases, all will be preceded by a 3 letter hotel code ("HPC") I can get the calculation to work correctly as a calc field, but here are my issues: - Sometimes the calc needs to be modified (because the client name parse needs to be changed for various reasons, etc.), thus it can't be a calc field - it needs to be a text field with calc auto-entered (correct me if I'm wrong!) - The text auto enter calc option starts evaluating the field once the first value is entered. Because of the constraints of this field type, that means that I get an incomplete value, defeating the purpose of having an auto-enter calc to begin with! What I'm hoping it will do: -I need the calculation not to be auto-entered until ALL 4 of the pieces of information are completed by the user. Then, I need the user to be able to modify the value a maximum of ONE TIME (this isn't absolutely important, but would be nice), after which the value cannot be modified. HELP!?
ernst Posted July 8, 2003 Posted July 8, 2003 Hi Michelle, You can accomplish this using: Case ( not ( IsEmpty(Field1) or IsEmpty(Field2) or IsEmpty(Field3) or IsEmpty(Field4) ), <<Insert Your Calculation here>>) As for your second question: Is it not a better idea to do have the user enter his of her Account ID in a modal dialog, that: - checks the Account ID when the user exits the dialog, not allowing exit when the user enters a ID that's not unique, or whatever criteria you have. - let's the user change the ID as long as the ID is not in use? Regards, Ernst.
MMBadger Posted July 8, 2003 Author Posted July 8, 2003 Many thanks, the Case scenario works perfectly. In terms of the second question: not quite sure how to go about doing what you described, though I'm definitely interested in learning. Could you provide a quick how-to? Thanks again, MMB
ernst Posted July 8, 2003 Posted July 8, 2003 Hi Michelle, I'll try to give you the general idea. You would need a separate layout for Account ID entry, and a script that's attached to a button somewhere on your main layout. Further you would need a global field to store the new entered Account ID. The script could do something like: If (Account ID may not be changed anymore by the user) display an error message else goto (Account entry layout) loop pause if (New Account ID entry is valid) copy New Account ID to Account ID exit the loop else display an error message end if end loop goto (original layout) end if I know this is more a sketch than a step by step instruction,so let me know if you need more detailed help. Regards, Ernst. p.s. The above listing does not want to show indented. That's a shame because it makes it less readable.
Recommended Posts
This topic is 7879 days old. Please don't post here. Open a new topic instead.
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