Passing a variable to Function in considtional fprmating

P

Paul Mayer

I am using InfoPath 2003 and my data structure is:
-myFields
-q:queryFields
-d:dataFields
-MyData
-Attchments

Attachment is a hyperlink field created using the concat
function to create a file with the UNC path, filename and
extension. This part works fine on my form. I have a
function named DFE with passes the file name and return
back true or false depending on wether the file name exist.
When I pass the parameter as text i.e."\\pc000\common\abc.txt"
the function works correctly. I want to pass the file name
as a variable:Attachment to the function DFE. I want to use this
function to do conditional formating in an optional section i.e.

not(xdExtension:DEF(Attachments))

The problem is that when I pass Attachments to the function DFE
I get an error saying that I have passed the incorrect number of
arguments or that there is an incorrect property in the FileExists
member. Which leads me to conclude that the file name is not being
properly being passed to the function.

1. Is is possible to pass a variable Attachments to the function?
2. Is it possible to pass the value as a hyperlink or does the variable
have to be in some other format such as text?
3. What is the correct way to pass the variable to this function in the
conditional formating so that the function will receive the file
name as its argument?
 
P

Paul Mayer

Paul Mayer said:
I am using InfoPath 2003 and my data structure is:
-myFields
-q:queryFields
-d:dataFields
-MyData
-Attchments

Attachment is a hyperlink field created using the concat
function to create a file with the UNC path, filename and
extension. This part works fine on my form. I have a
function named DFE with passes the file name and return
back true or false depending on wether the file name exist.
When I pass the parameter as text i.e."\\pc000\common\abc.txt"
the function works correctly. I want to pass the file name
as a variable:Attachment to the function DFE. I want to use this
function to do conditional formating in an optional section i.e.

not(xdExtension:DEF(Attachments))

The problem is that when I pass Attachments to the function DFE
I get an error saying that I have passed the incorrect number of
arguments or that there is an incorrect property in the FileExists
member. Which leads me to conclude that the file name is not being
properly being passed to the function.

1. Is is possible to pass a variable Attachments to the function?
2. Is it possible to pass the value as a hyperlink or does the variable
have to be in some other format such as text?
3. What is the correct way to pass the variable to this function in the
conditional formating so that the function will receive the file
name as its argument?

Does the file name have to have quote around it when it is sent to the
function to see if the file exists?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top