lpm Posted March 30, 2009 Posted March 30, 2009 WinXP FMAdv9 One-file solution I want to import all records with “2008-2009” in the Year Field from Table A to Table B, but I want to check first to see if any records already exist in Table B with “2008-2009” in the Year Field. What is the best way to script this and are relationships needed? I’ve tried the script below but I get a dialog that says “This operation could not be completed because the target is not part of a related table”. I’m confused because Tables A and B are related (by PersonID). ---- Go to Layout [“Table B Layout” (TABLE ] Enter Find Mode [] Set Variable [$Year; Value: Table A::globalYearField] Set Field [Table B::Year Field; Table A::globalYearField] Perform Find [] ---- Using the Script Debugger, I noticed that this script fails at the “Set Field” step because the value (2008-2009) from the Table A globalYearField is not pasted/set in the Table B year field. I hope you can help. TIA
mr_vodka Posted March 30, 2009 Posted March 30, 2009 If this is indeed a global then why are you even setting a variable here? Double check to make sure it is a global field.
lpm Posted March 30, 2009 Author Posted March 30, 2009 It is a global, so i tried the following and got the same error dialog -- “This operation could not be completed because the target is not part of a related table”. --------- Go to Layout [“Table B Layout” (TABLE ] Enter Find Mode [] Set Field [Table B::Year Field; Table A::globalYearField] Perform Find [] ---------- I can't seem to get the year (2008-2009) to paste into the "Table B::Year Field". I can do it manually, but not with a script. I tried substituting Table C for Table B, and it works great! I'm willing to try anything to get this right.
bcooney Posted March 30, 2009 Posted March 30, 2009 Is this your real script? From this example, Table B::Year Field can be set because you are on a layout based on Table B. However, if this is just pseudo-code, I would check that you are indeed in the correct context to set the field.
lpm Posted March 31, 2009 Author Posted March 31, 2009 Thank you both! I examined the relationships and found an error.
Recommended Posts
This topic is 5717 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