Criteria

Q

Quandary

Is their a way to build in to the path of the parameter statement a reference
to the active form with out using the active forms name?
For example if I what to put my parameters on a sub form and use the active
form to open a report with a command button, what would I write in the
criteria of the query with out using the actual name of the form in the
criteria path? I have tried to use “Like
[Forms]![%forms%]![Subform].[Parameter Field Name]†with no luck.

Please help me ïŠ
 
O

Ofer

No, as much as I know.
Just use the criteria in the open report command line
Dim MyWhereCondition as string
' For Number
MyWhereCondition= "FieldName Like " &
Me.SubFormControlName.Form.FieldControlName
'For String
MyWhereCondition= "FieldName Like '" &
Me.SubFormControlName.Form.FieldControlName & "'"

docmd.OpenReport "ReportName",,,MyWhereCondition
 
Top