Jump to content
  • 0

Trigger Help: Setting a Calculated Value from another table and updating #inserted data


BruceA

Question

After some "trigger" trial and error, I am finding I cannot update an #inserted record field with a calculated value. I can manage to get a value calculated but only in an "insert" event.

I have a table of text records called suffix "001" "002" "003" that are related to an account ID "12345"

On submission of new data, I want the default suffix for a new record to be calculated as "004"

Issue 1:

Using a trigger, I can select the parent table and calculate the MAX suffix which returns "003". When I add =1, I get 4, not "004"

is there a way to format the data to maintain the leading zero's?

Issue 2:

The only trigger I can get to make the calculation is an insert action. How can I structure the trigger to update the inserted data on submission of the new data?

Any advice would be greatly appreciated.

 

BA

 

 

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...