rstebbins Posted January 6, 2003 Posted January 6, 2003 I frequently do 'finds' in a single file database. I find a record, make an entry, then find the next record. Occasionally I will make a mistake and realize it after I have done a 'find' for a new record. I want to be able to go back to the previous record without having to do another 'find'. I would like to be able to create a 'Back' button. Thank you for any help you can give me. Randy
andygaunt Posted January 6, 2003 Posted January 6, 2003 Well, you could create a global text field to hold the unique identifier for that record (Lets call it gHoldRecordID ) Then, in your script for your find (Will have to be scripted, can't use CTRL/CMD & F) Enter Find Mode [Pause] Perform Find Set Field [ gHoldRecordID, Unique ID Field ] Now, your back button script would be Enter Find Mode Set Field [unique ID Field, gHoldRecordID] Perform Find HTH
rstebbins Posted January 6, 2003 Author Posted January 6, 2003 Thanks for the reply Andy but you'll need to use a little more elementary language for me on this one. I'm not a total newbie to Filemaker but I have done almost no scripting. Each record does not have it own unique identifier. If one is necessary is there a way to generate one in existing records automatically? Would you please repeat your last post a bit more descriptively? Thanks, Randy
andygaunt Posted January 6, 2003 Posted January 6, 2003 Randy, OK. No problem. Unique Identifier. This is simply a field which in the options for that field you have set the serial number auto enter option. Now, you can Find All records, click into this field and choose to do a replace CTRL & =. Because this is a serial number field, check the serial number option and check the update serial number in entry options. Now, each of your records has a unique id. Always a good thing in ANY database. Now, create a script for your FIND. You will not be able to do CTRL & F to find, it will have to be from a button. Set Field [ gHoldRecordID, Unique ID Field ] Enter Find Mode [Pause] Perform Find This will remember the current ID for that record, then find your new record (sorry, put the set field at the wrong end of the script in previous post) Now, your back button script would be Enter Find Mode Set Field [unique ID Field, gHoldRecordID] Perform Find Eac of these scripts can be assigned to a button, using the perform script step and selecting the relevant script from the options. Hope this is a bit clearer
rstebbins Posted January 6, 2003 Author Posted January 6, 2003 Okay, thanks. I think I can follow that. If not I'll be back. Thank you very much.
rstebbins Posted January 6, 2003 Author Posted January 6, 2003 Small problem. In the 'Define Fields' dialogue box I have created a global field called gHoldRecordID. When I then click on the Options button I get an option to choose the type of data it would hold, ie text, number, date, time and container. I chose number. I don't see an option for serial number. I did see it when I made the field a number (not global), but now it is not an option. I guess I'm still confused. Can you clear it up for me some more? Thanks, Randy
andygaunt Posted January 6, 2003 Posted January 6, 2003 OK. You need a field for the Unique Identifier. This in the example was Just called Unique ID (You can call it RecordID or anything else). This is just a number field, with auto enter serial set in the options. The global gHoldRecordID is used as a temporary holding place for the records identifier. Why a global? A global field is the same for every record in the current FileMaker session and it is different for each user. So whatever you put in the global that is its value for every record in your database. HTH
rstebbins Posted January 6, 2003 Author Posted January 6, 2003 We are almost there I think. I have created the global field, which is empty, and the RecordID field which has consecutive serial numbers. I created two scripts as follows. This is exactly how they look. Find Button: Set Field [""gHoldRecordID""RecordID""] Enter Find Mode [Pause] Perform Find [ ] Back Button: Enter Find Mode [ ] Set Field [""RecordID""gHoldRecordID""] Perform Find [ ] After doing a couple of finds with the Find Button and then clicking the Back Button I get a message that "No records match this request". Any suggestions? Thanks, Randy
andygaunt Posted January 6, 2003 Posted January 6, 2003 When you do a Find, does it set the global to the value of the previous record. Check the current record's unique ID, then do the find (using the button with the script) Does the global now hold that value. If you then hit the back button, does it go to that previous record?
rstebbins Posted January 6, 2003 Author Posted January 6, 2003 No. The global field is always empty. Randy
Recommended Posts
This topic is 7996 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