Concatenation

petern
StarLounger
Posts: 72
Joined: 10 Feb 2010, 15:45
Location: Kitchener, Ontario

Concatenation

Post by petern »

I am using the Concat function supplied to me several years ago by Hans and have run into a snag with parameters in a query which the function comments are clear will cause a snag. If I tweak the function to use a querydef with parameters instead of the recordset will I be able to write the results to the query which will feed my report or will I need to put all this into a temp table instead?

I'm fairly comfortable doing either I'd just rather not start one method and find out it was doomed to failure :groan:

Thanks in advance
Peter N

User avatar
HansV
Administrator
Posts: 78412
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Concatenation

Post by HansV »

If you add a calculated column to a query that uses the Concat function, and use the query as record source for a report, the calculated column will be available in the report like any other field.

As is, the first argument of the Concat function cannot be the name of a parameter query, since the code opens a DAO recordset on it, and you can't open a recordset on a parameter query directly (you have to supply the parameter values before opening the recordset. If possible, I'd use the third argument of Concat to specify a where-condition. If that is not possible, you'd have to modify the function.
Best wishes,
Hans