Symont Posted June 3, 2005 Posted June 3, 2005 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
MoonShadow Posted June 3, 2005 Posted June 3, 2005 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.
Recommended Posts
This topic is 7113 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