Enigma20xx Posted February 20, 2011 Posted February 20, 2011 I am new in data bases so I still know only a few things, hope you can help. I’m trying to make a script to generate records based on related ones but I can’t end it. First related record goes ok, then goes to the next and ok too, but on the third goes back to the first and jumps to next, so I get first and second record ok and a nonstop second record. I’ll appreciate your help. Set Variable [ $P1; Value:Table 1::P1_ID ] Go to Related Record [ From table: “Table A”; Using layout: “Table A” (Table A) ] [ Show only related records ] Go to Record/Request/Page [ First ] Loop Set Variable [ $As1; Value:Table A::A1_ID ] Go to Layout [ “Table B” (Tabla ] New Record/Request Set Field [ Table B::A1_ID; $As1 ] Set Field [ Table B::P1_ID; $P1 ] Go to Related Record [ From table: “Table A”; Using layout: “Table A” (Table A) ] [ Show only related records ] Go to Record/Request/Page [ Next; Exit after last ] End Loop
comment Posted February 20, 2011 Posted February 20, 2011 a script to generate records based on related ones I am not sure what exactly are you trying to accomplish here. I think you want: Set Variable [ $P1; Value:Table 1::P1_ID ] If [ not IsEmpty ( Table A::P1_ID ) ] Go to Related Record [ From table: “Table A”; Using layout: “Table A” (Table A) ][ Show only related records ] Go to Record/Request/Page [ First ] Loop Set Variable [ $As1; Value:Table A::A1_ID ] Go to Layout [ “Table B” (Table ] New Record/Request Set Field [ Table B::A1_ID; $As1 ] Set Field [ Table B::P1_ID; $P1 ] Go to Layout [ “Table A” (Table A) ] Go to Record/Request/Page [ Next; Exit after last ] End Loop End If
Recommended Posts
This topic is 5021 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