August 14, 200421 yr I have a script where I am trying to enter these results... Date > Date in Related Table Name > Name in Same as above table ID > ID in same as above table All three related fields are visable on the screen which I am copying. It will only enter the results if I have Script Debug ON. If I have SD off it only enters one of the results, the Date. Any Ideas?
August 14, 200421 yr Author It still only sets the Date, but the others are left blank. But if I run Script Debug it sets them all like it should. I am perplexed. I have also run the update.
August 17, 200421 yr Hi Rikturscale, Try setting the fields to script parameter values instead of relying on the relationship. Hopefully, you're using a button to run the script. Just attach the required values as parameters to the button. You can use GetAsText(related::date) & "|" & related::name & "|" & related::ID to seperate the three fields. When setting the field values in your script, you use the middle function to extract the portion of the parameter you need: For date: GetAsDate(Middle (Get(ScriptParameter), 1, Position(Get(ScriptParameter), "|", 1, 1) -1)) For Name: Middle (Get(ScriptParameter), Position(Get(ScriptParameter), "|", 1, 2) + 1, Position(Get(ScriptParameter), "|", 1, 3) - Position(Get(ScriptParameter), "|", 1, 2) -1) For ID: Middle (Get(ScriptParameter), Position(Get(ScriptParameter), "|", 1, 2) + 1, Length(Get(ScriptParameter)) - Position(Get(ScriptParameter), "|", 1, 2)) If there's a possibility that your name or ID field will have "|" in it, change the separator to something else. If you find that this doesn't work either, then there's probably something wrong with the relationship. Hope this helps, Cobra Edit: Corrected the position functions within the last middle function.
Create an account or sign in to comment