1

I have a form and in the form is a sub form that displays rows from a query. One of the columns in the subform is the DNANumber. The report works 100%. Problem is, when I call the report using the following code,

strWhereClause = "[DNANumber]=" & strText
DoCmd.OpenReport "Certificate", acViewPreview, , strWhereClause, , acHidden

I get a popup message asking for the parameter value, also displaying that exact value it is looking for above the textfield. I have checked all the spelling in the queries, forms , subforms and tables and controlls. Everything is fine. Why do I get this popup message. Further, If I type in the value, it displays the report without a problem.

4

1 回答 1

3

如果是文本数据类型,请在构建时[DNANumber]的值周围添加引号。strTextstrWhereClause

strWhereClause = "[DNANumber]='" & strText & "'"
于 2013-09-19T14:12:48.737 回答