Report Record Source

  • Thread starter Thread starter gr
  • Start date Start date
G

gr

Hello, I want to let users select which field should be
included in a report.
I already code a form in order to get strQryPersonal which
is the SQL string (SELECT ..... FROM ... WHERE ... )

What I don't how to do is to set the Record Source
property of a report (saved report) to this
strQryPersonal. Should I use the DAO CreateQueryDef? (I
don't want to store the query) or is it possible to set
the RecordSource property = [Forms]![frmPersonnelInfo]!
[frmCV].[Form]![txtQryPersonal]

Also how should I manage the fact that sometimes some
fields will be chosen by the user and sometimes not (Can
Grow, Can Shrink, Visible, not visible) in order to
provide a nice layout?

thx.
gr
 
gr said:
Hello, I want to let users select which field should be
included in a report.
I already code a form in order to get strQryPersonal which
is the SQL string (SELECT ..... FROM ... WHERE ... )

What I don't how to do is to set the Record Source
property of a report (saved report) to this
strQryPersonal. Should I use the DAO CreateQueryDef? (I
don't want to store the query) or is it possible to set
the RecordSource property = [Forms]![frmPersonnelInfo]!
[frmCV].[Form]![txtQryPersonal]

Also how should I manage the fact that sometimes some
fields will be chosen by the user and sometimes not (Can
Grow, Can Shrink, Visible, not visible) in order to
provide a nice layout?


You can set the report's RecordSource in the report's Open
event procedure:

Me.RecordSource=Forms!frmPersonnelInfo!frmCV.Form!txtQryPersonal

You can also set most control, section and group level
properties in the Open event.
 
Back
Top