Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Auto-Enter Calculated RecordID

Featured Replies

When I create a new record, I want to use the auto-enter feature to calculate the contents of the RecordID field (a text "key" field). I want the RecordID field calculation to use three other fields in the new record. The calculation would be as follows: LastName&", "& FirstName&" - "&Phone, where LastName, FirstName, and Phone are fields in the new record. I like this approach because the RecordID field is understandable to the user (rather than a sequence number) and, consequently, debugging and managing the database is easier. The problem I'm having is that the calculation occurs when the new record is opened and these three fields are blank. Consequently, the RecordID field does not contain any information except the ", -". Is there someway to delay the calculation until the fields are populated? Is there some other way to work around this situation?

Thanks, Keith Silva

quote:

Originally posted by Keith Silva:

When I create a new record, I want to use the auto-enter feature to calculate the contents of the RecordID field (a text "key" field). I want the RecordID field calculation to use three other fields in the new record. The calculation would be as follows: LastName&", "& FirstName&" - "&Phone, where LastName, FirstName, and Phone are fields in the new record. I like this approach because the RecordID field is understandable to the user (rather than a sequence number) and, consequently, debugging and managing the database is easier. The problem I'm having is that the calculation occurs when the new record is opened and these three fields are blank. Consequently, the RecordID field does not contain any information except the ", -". Is there someway to delay the calculation until the fields are populated? Is there some other way to work around this situation?

Ok, here is the problem. You are choosing user-definable data to use are your IDs. This is bad, both for the reason above (the data does not exist to build the key) and because this data can change (key "Smith - John - 865-2345" can be easily associated with Mr Johnson Smithey at 234-3454) or worse might be duplicated.

Setup a standard ID system as follows: RecordID_kpt = Auto-entered Calculation [status(CurrentDate) & "-" & Status(CurrentTime) & "-" & Status(CurrentRecordID)]

Do not make this available or even visible to the user, and use this for all of your important relationships and functionality that relies on IDs. This insures that each record get a UNIQUE, UNDUPLICATABLE key.

Use the funky Name & PhoneNumber type of IDs for what is shown to the customer on the screen. They will never know that you are not using this for the relationships and functionality.

------------------

=-=-=-=-=-=-=-=-=-=-=-=-=

Kurt Knippel

Consultant

Database Resources

mailto:[email protected]

http://www.database-resources.com

=-=-=-=-=-=-=-=-=-=-=-=-=

  • Author

Sounds like the voice of reason and experience talking. I'm going to follow your advice. Thanks for the response to my question. Your answers to other questions have been very helpful to me as well.

Regards, Keith Silva

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.