I'm trying to create a field that stores the location of a file that contains a scanned image. I've called the field "facesheet" and made it an image file reference field.
What I want to do is assign the file name when the record is created using a default value in the field rules. For example, John Smith's (whose birthday is 05/01/1997) scanned image file would be named:
SMI050197.jpg
I have no problem creating a calculated field to create that file name in the field rules with this formula:
substr(patientl,1,3)+substr(dtoc(bday),1,2)+substr(dtoc(bday),4,2)+substr(dtoc(bday),7,2)+".jpg"
But when I try to add the directory to the name using:
"C:\DATA\"+substr(patientl,1,3)......and all the rest
I get an error telling me that it is an invalid or incomplete expression. It's the \" part of that string that's doing it.
First, should my default expression for an image file reference field evaluate to a character string like I'm doing? Or should I make "facesheet" a character field? I'm going to create a script that opens that file from a form so the user can print it or look at it. I don't need the image itself to be a part of the record at all. I've changed the type to character, and I get the same error.
When I use action scripting to create the button to open the non-A5 file, there is an option where I can specify an expression that evaluates to the name of the file I want to open. I was going to put the fieldname "facesheet" there.
In a perfect world, I would have something in A5 that would allow the user to scan the image by pressing a button on the form, name it, drop that name into the "facesheet" field and then press another button to look at it later. But, I don't think that first part is possible, at least not from what I've seen on the forum here. So, I'm assigning the name when the record is entered and scanning the image and naming it the same thing outside A5.
Thanks for any help you can give me with this.
Linda
What I want to do is assign the file name when the record is created using a default value in the field rules. For example, John Smith's (whose birthday is 05/01/1997) scanned image file would be named:
SMI050197.jpg
I have no problem creating a calculated field to create that file name in the field rules with this formula:
substr(patientl,1,3)+substr(dtoc(bday),1,2)+substr(dtoc(bday),4,2)+substr(dtoc(bday),7,2)+".jpg"
But when I try to add the directory to the name using:
"C:\DATA\"+substr(patientl,1,3)......and all the rest
I get an error telling me that it is an invalid or incomplete expression. It's the \" part of that string that's doing it.
First, should my default expression for an image file reference field evaluate to a character string like I'm doing? Or should I make "facesheet" a character field? I'm going to create a script that opens that file from a form so the user can print it or look at it. I don't need the image itself to be a part of the record at all. I've changed the type to character, and I get the same error.
When I use action scripting to create the button to open the non-A5 file, there is an option where I can specify an expression that evaluates to the name of the file I want to open. I was going to put the fieldname "facesheet" there.
In a perfect world, I would have something in A5 that would allow the user to scan the image by pressing a button on the form, name it, drop that name into the "facesheet" field and then press another button to look at it later. But, I don't think that first part is possible, at least not from what I've seen on the forum here. So, I'm assigning the name when the record is entered and scanning the image and naming it the same thing outside A5.
Thanks for any help you can give me with this.
Linda
Comment