March 7, 201411 yr Newbies Hi. I have 12 fields with the names Phone1, Phone2, Phone3, .... I have go through each and do some work on it. Obviously, I don't want to recreate the same procedure 12 times. I like to use the field by the count I'm on. Here's the start of the code: set variable [$PHCount; Value: 0 ] Loop set variable [$PHCount; Value: $PHCount + 1 ] ##### here I'd to set a variable to field Phone and whatever $PHCount is on ##### so if $PHcount is equal to 1 the variable is equal to Phone1 End Loop TIA. Boyd
March 7, 201411 yr The Phone fields should be separate records in a related table. That table should contain the fields ID (auto entered serial number), MainID, and Phone. It should be related to your main table by MainTable::<yourIDfield> = Phones::MainID. Your script would then be: Freeze Window Go to Related Records[show only related records; From table::Phones;Using layout:Phones] Go to Record[first] Loop #perform your operation Go to Record[next; Exit after last] End Loop
March 7, 201411 yr Author Newbies Doug: Thanks for the tip. Not exactly what I did, though. I decided using a repetition field made a lot more sense. Thanks. Boyd
March 7, 201411 yr I decided using a repetition field made a lot more sense. You may change your mind if a) you ever have to create a report based on those phone numbers ("how many are in Area Code 212?") or b ) you have a record with a 13th phone number.
March 7, 201411 yr Author Newbies Doug: Deinitely. But, this was a case of where I ws importing a flat file with multiple phone numbers. In fact, it was a labeled phone numbers, but had phones and emails in it. I just needed to massage the data and export it right out. Thanks. Boyd
March 7, 201411 yr And if they had been separate records then you would have just performed a simple find operation to separate the email records from the phone records.
March 7, 201411 yr ##### here I'd to set a variable to field Phone and whatever $PHCount is on ##### so if $PHcount is equal to 1 the variable is equal to Phone1 GetField ( "Phone" & $PHCount )
Create an account or sign in to comment