June 3, 200520 yr Ok, I'm new to FMP so it may be simple, but I still need help. I'm trying to use a layout (in browse mode) to find records in related tables. I want to use two or three fields to make research in another table. If I use only one field, I can do a copy-paste, but it doesn't work (or I simply don't know how) with more than one field. Can someone help me? Thanks
June 3, 200520 yr Use global text fields. Allow User to enter information then provide a GO button. Script attached to button, for an AND condition, would be something like (untested) Allow User Abort [ Off ] Set Error Capture [ On ] Freeze Window Go To Layout [ yourRelatedLayout ] Enter Find Mode [ ] Set Field [ Related::Field1; Main::Global1 ] Set Field [ Related::Field2; Main::Global2 ] Set Field [ Related::Field3; Main::Global3 ] Perform Find [ ] If [ Get(LastError) ] Show Custom Dialog [ "OK"; "No Records Found" ] Show All Records Go To Layout [ Original Layout ] End If If you want an OR condition, ie, anything matches change Set Field[] portions to: Enter Find Mode [ ] Set Field [ Related::Field1; Main::Global1 ] New Record Request Set Field [ Related::Field2; Main::Global2 ] New Record Request Set Field [ Related::Field3; Main::Global3 ] Perform Find [ ] Note: The globals can come from anywhere because they can be accessed from anywhere; even unrelated tables. I use many of the same globals for various things.
Create an account or sign in to comment