A family of Microsoft relational database management systems designed for ease of use.
A modified version of the function could be written that would check for and fill in any form/control references in the query. Give me a few minutes, and I'll post it.
I'm not comfortable posting Allen's code directly -- it's better to refer to his website -- so I'll post instructions for modifying the code posted at http://allenbrowne.com/func-concat.html .
- Among the Dim statements at the head of the procedure, add these:
Dim db As DAO.Database
Dim qdf As DAO.QueryDef
Dim prm As DAO.Parameter
- Replace this statement:
Set rs = DBEngine(0)(0).OpenRecordset(strSql, dbOpenDynaset)
with these:
Set db = DBEngine(0)(0)
Set qdf = db.CreateQueryDef("", strSql)
For Each prm In qdf.Parameters
prm.value = Eval(prm.Name)
Next prm
Set rs = qdf.OpenRecordset(dbOpenDynaset)
- Near the end, where he is cleaning up after the Exit_Handler: statement label, insert these statements:
Set qdf = Nothing
Set db = Nothing
That's it. I suggest you comment the inserted statements to show that they are not part of Allen Browne's original code. That way you'll know not to blame him if it doesn't work. <g>