Apologies in advance, I'm an absolute beginner so likely to display embarassing ignorance.
I have a table containing details of people.
I keep documents relating to these people in individual folders.
I'm trying to create a query that shows me whether I have certain specific documents on file for each person.
In a VBA function I can go and look in a specified place to see if there is a file present e.g. in P:\Fred Bloggs\Driving Licence\
So I have a calculated field "Driving Licence" and for that I call my function passing it the person's name and the string "Driving Licence" and the function tells me whether there's a file in the "Driving Licence" folder for that individual.
Now imagine that besides driving licence I have several other document types that I'm trying to do the same thing for. In each case the logic is the same, the only thing that varies is the name of the document. So I could follow suit for the rest of the fields e.g. call my function passing it:
* name and "Birth Certificate" for the "Birth Certificate" field
* name and "Security Credentials" for the "Security Credentials" field
... and so on.
I'd really prefer to enhance my VBA function so that it just needs to be passed the name and then it will use that together with the field name to do the file lookup. So then each calculated field willl have the same code in it, just calling the function using the person's name.
How do I get the name of the current field within my function, so that I can combine it with the incoming person's name to specify the folder to go look in for the relevant document?
I have a table containing details of people.
I keep documents relating to these people in individual folders.
I'm trying to create a query that shows me whether I have certain specific documents on file for each person.
In a VBA function I can go and look in a specified place to see if there is a file present e.g. in P:\Fred Bloggs\Driving Licence\
So I have a calculated field "Driving Licence" and for that I call my function passing it the person's name and the string "Driving Licence" and the function tells me whether there's a file in the "Driving Licence" folder for that individual.
Now imagine that besides driving licence I have several other document types that I'm trying to do the same thing for. In each case the logic is the same, the only thing that varies is the name of the document. So I could follow suit for the rest of the fields e.g. call my function passing it:
* name and "Birth Certificate" for the "Birth Certificate" field
* name and "Security Credentials" for the "Security Credentials" field
... and so on.
I'd really prefer to enhance my VBA function so that it just needs to be passed the name and then it will use that together with the field name to do the file lookup. So then each calculated field willl have the same code in it, just calling the function using the person's name.
How do I get the name of the current field within my function, so that I can combine it with the incoming person's name to specify the folder to go look in for the relevant document?