What is the proper syntax for a function in a module to return a value to a query? I would like the function to perform a series of nested IIf statements that are too numerous to perform in a sql statement (Access returns an error). The function needs to reference fields from the table being used in the query.
query1 has a field with expression- clinphys: clinic()
which calls the function clinic()
The function in the module is declared as below([physexam] would be a field in the table that I would like to compare):
public function clinic() as string
if [query1].[physexam]=-1 then
clinic="yes"
else
clinic = "no"
end if
When I use this function, I do not get an error message, but I do not get any values returned.
Has anyone done anything like this before? Thank you.
query1 has a field with expression- clinphys: clinic()
which calls the function clinic()
The function in the module is declared as below([physexam] would be a field in the table that I would like to compare):
public function clinic() as string
if [query1].[physexam]=-1 then
clinic="yes"
else
clinic = "no"
end if
When I use this function, I do not get an error message, but I do not get any values returned.
Has anyone done anything like this before? Thank you.