July 31, 200223 yr Newbies I've been searching the forums and haven't found an answer to my question, so if it
July 31, 200223 yr Open what type of file? Another FileMaker File? Or a different type of file? e.g. PDF, Excel, Word, etc... based on the filename? If it's a FileMaker file, just use the "Open" command, and you can check if it's open or not use the Design Function, "DatabaseNames" to determine this.
July 31, 200223 yr Author Newbies I'd like to open a FM database. The name of that database is stored in a calculated field which joins chunks of text and numbers from other fields (e.g. in2002ov01, in2001m02 and so on). Now I have a button in a layout which tab changes for each record depending on the calculated field. Would it be possible to have a script that opened the file that appears on the tab (which could be different from record to record)? I hope I've explained myself better this time. TIA
July 31, 200223 yr A SIMPLE script example: If [DatabaseName = "Client.fp5"] Open [Client.fp5] End If If [DatabaseName = "Account.fp5"] Open [Account.fp5] End If If [DatabaseName = "Order.fp5"] Open [Order.fp5] End If
July 31, 200223 yr Sound like you will need a script with a series of IF statements to determine which file to open. If[TabName = in2002ov01] Open [in2002ov01.fp5] Exit Script End If If[TabName = in2001m02] Open [in2001m02.fp5] Exit Script End If Etc.., Etc.. Thank goodness you can highlight script steps and duplicate them all at once now. I would put the "most commonly" accessed files at the top. Then the script will come across those first and then exit. (Instead of having to go through the entire script to get to the bottom to open the file) Hope that's what you were looking for.
Create an account or sign in to comment