In my project I have a table1
that has an ID and a text field. table2
has a multi-valued field multifield
wherein I can select multiple values from table
(via lookup).
Now, I have query1
where I want to pull the value from multifield
- not multifield.value
and pass it to a VBA function, like this: IDsToNames: table2.multifield
. Problem is that VBA gives me this error:
The multi-valued field 'table2.multifield` is not valied in the expression IDsToNames(table2.multifield)
Now, I've tried with IDsToNames([table2].[multifield])
with the same results.
Here is my query's SQL:
SELECT table2.Title, table2.multifield, IDstoNames(table2.multifield) AS FieldNames
FROM table2;
If I remove the IDsToNames
function from the SQL, then table2.multifield
by itself will return the IDs like: 5, 4, 1
properly. I'm trying to fetch the second column of table1
instead of the first one that includes the IDs. So i figured I'd try passing that field to a function and perform a string split and them look them up with dlookup in a loop. But I can't get the field data into the function.
Is there a way to do this?