GrandMasterTuck
In need of medication
- Local time
- Today, 16:21
- Joined
- May 4, 2013
- Messages
- 129
[SOLVED] ConcatRelated issue with TempVars
Hi folks,
Here's hoping somebody knows a way around this. I have a form that has a field that's supposed to fetch a list of values from a query and concatenate them. I use Allen Browne's code for this:http://allenbrowne.com/func-concat.html
Here's my field code:
This works perfectly, no problems. But I need to adjust the value of that PersonID integer based on the record selected on my form. It's not always going to be 83344. In fact, the ONLY time it will be 83344 is if that specific person record is selected.
I tried several different ways of getting the data. I tried a TempVars value in the code, and set said TempVar upon opening the form, like so:
And I get that same error everybody else gets, where it says TOO FEW PARAMETERS, EXPECTED 1.
So I tried to set a field on the form to the TempVar's value, and reference the field instead of the TempVar, like so:
Same error.
I switched back to that hardcoded integer, and it runs perfect. So I know it's a problem with the way I'm supplying a value for that PersonID. I just don't know how to get it to work. And I NEED this to work!
I tried single quotes, double quotes, I tried coding quotes around the value of the PersonID (even though that value is an integer in the table). I even tried to code parts of the string in pieces in VBA, then assemble a new string from the pieces and encasing that in an EVAL() function... nothing.
Any idea how I can get this to work?
Hi folks,
Here's hoping somebody knows a way around this. I have a form that has a field that's supposed to fetch a list of values from a query and concatenate them. I use Allen Browne's code for this:http://allenbrowne.com/func-concat.html
Here's my field code:
Code:
=ConcatRelated('Data','tblNamesAliases','PersonID=83344')
This works perfectly, no problems. But I need to adjust the value of that PersonID integer based on the record selected on my form. It's not always going to be 83344. In fact, the ONLY time it will be 83344 is if that specific person record is selected.
I tried several different ways of getting the data. I tried a TempVars value in the code, and set said TempVar upon opening the form, like so:
Code:
=ConcatRelated('Data','tblNamesAliases','PersonID=[TempVars]![TheID]')
And I get that same error everybody else gets, where it says TOO FEW PARAMETERS, EXPECTED 1.
So I tried to set a field on the form to the TempVar's value, and reference the field instead of the TempVar, like so:
Code:
=ConcatRelated('Data','tblNamesAliases','PersonID=[MyFormField]')
Same error.
I switched back to that hardcoded integer, and it runs perfect. So I know it's a problem with the way I'm supplying a value for that PersonID. I just don't know how to get it to work. And I NEED this to work!
I tried single quotes, double quotes, I tried coding quotes around the value of the PersonID (even though that value is an integer in the table). I even tried to code parts of the string in pieces in VBA, then assemble a new string from the pieces and encasing that in an EVAL() function... nothing.
Any idea how I can get this to work?
Last edited: