0
votes

I am attempting to use Allen Browne's ConcatRelated() function, but I am getting an error of:

Error 3061: Too few parameters. Expected 1

Below is the syntax I input into my query ->

ConcatRelated("Product","[_ProdInfo]","OrderNumber = " & [OrderNumber])

What should I change so that this does not produce the error and displays the results I am after?

Further explanation:

  • Field Name is Product
  • Table Name Is _ProdInfo
  • The field to match on is OrderNumber and it is a short text type
1

1 Answers

3
votes

As ConcatRelated() link describe:

If the foreign key field is Text (not Number), include quote marks as delimiters, e.g.: "[ForeignKeyFieldName] = """ & [PrimaryKeyFieldName] & """"

And since your OrderNumber is a text field, add the needed quotes:

ConcatRelated("Product", "[_ProdInfo]", "OrderNumber = """ & [OrderNumber] & """)

Or with single quotes:

ConcatRelated("Product", "[_ProdInfo]", "OrderNumber = '" & [OrderNumber] & "'")