ssaucedo Posted August 7, 2008 Posted August 7, 2008 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?
mr_vodka Posted August 7, 2008 Posted August 7, 2008 SEt Variable [ $value; YourField ] Enter Find Mode [] Set Field [YourField; $value ] Perform Find []
ssaucedo Posted August 7, 2008 Author Posted August 7, 2008 (edited) 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, 2008 by Guest
Ted S Posted August 7, 2008 Posted August 7, 2008 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.
ssaucedo Posted August 7, 2008 Author Posted August 7, 2008 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.
Quartekoen Posted August 7, 2008 Posted August 7, 2008 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.
Ted S Posted August 7, 2008 Posted August 7, 2008 (edited) 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, 2008 by Guest
ssaucedo Posted August 7, 2008 Author Posted August 7, 2008 (edited) Ted: Brilliant! It worked perfectly! I still want to learn more about the set variable, but I will do it later. :-) Edited August 7, 2008 by Guest
Fitch Posted August 7, 2008 Posted August 7, 2008 This comes up on a regular basis: "Although this technique is fine for single-user systems, it is seriously flawed for multi-user systems."
ssaucedo Posted August 8, 2008 Author Posted August 8, 2008 didn't realize it was a link, thanks for the info very helpful.
Recommended Posts
This topic is 5952 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