August 7, 200817 yr I am trying to create a script that will "perform a find" based on the value of a field in the current record. The find criteria will be based on the whatever record is currently "on focus" pardon my access lingo. How do I do that? What do I type in the criteria box?
August 7, 200817 yr SEt Variable [ $value; YourField ] Enter Find Mode [] Set Field [YourField; $value ] Perform Find []
August 7, 200817 yr Author thanks for the info just a couple of questions. Do I copy that with no changes (except the field name) right into my script or the criteria box? If into the script then do i leave the criteria box empty? Thanks for the suggested reading. Edited August 7, 200817 yr by Guest
August 7, 200817 yr I should mention that this can be done without a script by simply right clicking while the cursor is in the field and choosing FIND MATCHING RECORDS. You could also extend or constrain the found set in the same manner. That said, I'm not sure Macs have a right mouse button. The last time I laid hands on a Mac, back in the early 1990's, I think there was only one button.
August 7, 200817 yr Author Thanks for the info, the only thing is that this is part of a larger script and there is a need to isolate the current record.
August 7, 200817 yr From your description, it sounds like you want to be able to have the user choose a field, then perform a find based on that field only. If that's the case, you may want to use the Get( ActiveFieldContents ) and Get(ActiveFieldName) functions. The script may be set up something like Set Variable [$variable; Get( ActiveFieldContents )] Set Variable[$field; Get(ActiveFieldName)] Enter Find Mode [] Set Error Capture [On] Set Field[$field; $variable] Perform Find[] Setting a variable will always refer to the field in the record currently being viewed.
August 7, 200817 yr Let me see if I have this right. The user may be browsing many records and you would like the user to be able to change the found set so that only the current record is showing. If this is correct then try adding these steps at the proper place in your script or by making them into a new script: Show All Records Omit Record Show Omitted Only Edited August 7, 200817 yr by Guest
August 7, 200817 yr Author Ted: Brilliant! It worked perfectly! I still want to learn more about the set variable, but I will do it later. :-) Edited August 7, 200817 yr by Guest
August 7, 200817 yr This comes up on a regular basis: "Although this technique is fine for single-user systems, it is seriously flawed for multi-user systems."
Create an account or sign in to comment