Thank you. That did indeed do it. How do I hide this new window so that I can't see it go back and forth...?
Many thanks!! Ron -----Original Message----- From: Jason L DeLooze [mailto:[EMAIL PROTECTED] Sent: Friday, November 14, 2008 12:05 PM To: FileMaker Pro Discussions Cc: Ron Subject: Re: Script problem Ron, When your script switches layouts (in the "WriteMetaData" script), you lose field focus in the "ConvertUVMC" layout. Thus, the "Go to Next Field" (after you return to that layout) goes to the 1st field in the tab order. The fix is to open a New Window in the WriteMetaData script (very 1st step), then close the Window just before you leave the WriteMetaData script. Doing so will place you back in the ConvertUVMC layout of the original window with the cursor still active in the current field. Also, you do not need the "Go to Layout [ "ConvertUVMC" (ConvertUVMC) ]" which follows the "Perform Script [ "WriteMetaData" ] since you will still be on that layout. Best wishes, Jason L. DeLooze Annapolis, MD USA "God created the integers, all else is the work of man" On 11/14/08 at 11:12 AM -0500, Ron wrote: > I have the following script > Go to Layout [ "ConvertUVMC" (ConvertUVMC) ] > Set Variable [ $$vcntr; Value:1 ] > Go to Record/Request/Page > [ First ] > Go to Field [ ConvertUVMC::HouseholdID ] > Loop > Set Variable [ $$vhhid; Value:ConvertUVMC::HouseholdID ] > Set Variable [ $$vfieldno; Value:$$vcntr ] > Set Variable [ $$vfieldname; Value:Get(ActiveFieldName) ] > Set Variable [ $$vfieldtype; Value:FieldType(Get(FileName);$$vfieldname) ] > If [ Left ($$vfieldname;4 ) _ "1990" or Left ($$vfieldname;4 ) _ "2009" ] > Set Variable [ $$vyear; Value:Left ($$vfieldname;4 ) ] > Set Variable [ $$vfieldnameremainder; Value:Middle ($$vfieldname;5 ;99 ) ] > Else > Set Variable [ $$vfieldnameremainder; Value:$$vfieldnname ] > End If > Perform Script [ "WriteMetaData" ] > Go to Layout [ "ConvertUVMC" (ConvertUVMC) ] > Set Variable [ $$vcntr; Value:$$vcntr + 1 ] > Exit Loop If [ $$vcntr > 600 ] > Go to Next Field > End Loop > > The purpose is, possibly wishful thinking, to go thru the fm table (600 + fields) and extract certain fields, by number based on the table created here, to another table. > I am actually trying to build a relational database out of a monolithic FM table. > > Go To NextField does not work: I am getting the same field over and over. > Can somebody tell me why? > > (I know I need to do work on the FieldType statement: just haven't gotten there yet.) > > WriteMetaData > Go to Layout [ "FieldExtracted" (FieldExtracted) ] > New Record/Request > Set Field [ FieldExtracted::HHID; $$vhhid ] > Set Field [ FieldExtracted::FieldNo; $$vcntr ] > Set Field [ FieldExtracted::FieldName; $$vfieldname ] > Set Field [ FieldExtracted::NoRepeats; $$vnorepeats ] > Set Field [ FieldExtracted::FieldYear; $$vyear ] > Set Field [ FieldExtracted::FieldNameRemainder; $$vfieldnameremainder ] > Set Field [ FieldExtracted::FieldType; $$vfieldtype ] > > Thanks! > Ron Carr
